B
bill
With the following macro if a cell has a value of 5 in it, the macro
identifies it as a double, I would have expected it to come back as an
integer. Can you tell me what I'm doing incorrectly?
tia
Sub DisplayCellDataAttributes()
If Not RangeTools.IsRangeValid Then Exit Sub
Application.ScreenUpdating = False
For Each rngCell In Selection
If (VarType(rngCell.Cells) = vbInteger) Then MsgBox
rngCell.Address & vbCrLf & vbCrLf & " Cell DATA Format - Integer" &
vbCrLf & vbCrLf & "Data: " & rngCell.Cells & vbCrLf & vbCrLf &
"VarType: " & VarType(rngCell.Cells)
If (VarType(rngCell.Cells) = vbLong) Then MsgBox
rngCell.Address & vbCrLf & vbCrLf & " Cell DATA Format - Long" &
vbCrLf & vbCrLf & "Data: " & rngCell.Cells & vbCrLf & vbCrLf &
"VarType: " & VarType(rngCell.Cells)
If (VarType(rngCell.Cells) = vbDouble) Then MsgBox
rngCell.Address & vbCrLf & vbCrLf & " Cell DATA Format - Double" &
vbCrLf & vbCrLf & "Data: " & rngCell.Cells & vbCrLf & vbCrLf &
"VarType: " & VarType(rngCell.Cells)
Next
Application.ScreenUpdating = True
End Sub
identifies it as a double, I would have expected it to come back as an
integer. Can you tell me what I'm doing incorrectly?
tia
Sub DisplayCellDataAttributes()
If Not RangeTools.IsRangeValid Then Exit Sub
Application.ScreenUpdating = False
For Each rngCell In Selection
If (VarType(rngCell.Cells) = vbInteger) Then MsgBox
rngCell.Address & vbCrLf & vbCrLf & " Cell DATA Format - Integer" &
vbCrLf & vbCrLf & "Data: " & rngCell.Cells & vbCrLf & vbCrLf &
"VarType: " & VarType(rngCell.Cells)
If (VarType(rngCell.Cells) = vbLong) Then MsgBox
rngCell.Address & vbCrLf & vbCrLf & " Cell DATA Format - Long" &
vbCrLf & vbCrLf & "Data: " & rngCell.Cells & vbCrLf & vbCrLf &
"VarType: " & VarType(rngCell.Cells)
If (VarType(rngCell.Cells) = vbDouble) Then MsgBox
rngCell.Address & vbCrLf & vbCrLf & " Cell DATA Format - Double" &
vbCrLf & vbCrLf & "Data: " & rngCell.Cells & vbCrLf & vbCrLf &
"VarType: " & VarType(rngCell.Cells)
Next
Application.ScreenUpdating = True
End Sub