Sub type_donnée()
Dim i, j
Dim MyInteger As Integer
Dim MyLong As Long
Dim MySingle As Single
Dim MyDouble As Double
Dim MyVariant As Variant
Dim MyCurrency As Currency
MyInteger = 7.6 - 7.4
MyLong = 7.6 - 7.4
MySingle = 7.6 - 7.4
MyDouble = 7.6 - 7.4
MyVariant = 7.6 - 7.4
MyCurrency = 7.6 - 7.4
j = 1
Cells(1, j).Value = 'Type de donnée'
Cells(2, j).Value = 'Integer'
Cells(3, j).Value = 'Long'
Cells(4, j).Value = 'Single'
Cells(5, j).Value = 'Double'
Cells(6, j).Value = 'Variant'
Cells(7, j).Value = 'Currency'
j = 2
Cells(1, j).Value = 'Résultat de 7.6-7.4'
Cells(2, j).Value = MyInteger
Cells(3, j).Value = MyLong
Cells(4, j).Value = MySingle
Cells(5, j).Value = MyDouble
Cells(6, j).Value = MyVariant
Cells(7, j).Value = MyCurrency
Range('B2:B7').Select
Range('B7').Activate
Selection.NumberFormat = '0.000000000000000'
MsgBox 'Voici le résultat de ''monnombre = 7.6-7.4'' en fonction du type de donnée déclaré:' _
& Chr(10) & Chr(10) & _
'Interger:' & Chr(9) & Chr(9) & MyInteger & Chr(10) & _
'Long: ' & Chr(9) & Chr(9) & MyLong & Chr(10) & _
'Single: ' & Chr(9) & Chr(9) & MySingle & Chr(10) & _
'Double: ' & Chr(9) & Chr(9) & MyDouble & Chr(10) & _
'Variant: ' & Chr(9) & Chr(9) & MyVariant & Chr(10) & _
'Currency: ' & Chr(9) & MyCurrency & Chr(10)
End Sub