All cells are formatted as "General". Range(Cells(1, 1), Cells(5, 5)) all contain a 2. Getting type mismatch error - see "Watch" at bottom.
Declared in a module:
Worksheet:
Watch return:
How is TmpData getting changed from a variant to an integer?
</type>
Declared in a module:
Code:
Option Explicit
Public OldData As Variant
Public Newdata As Variant
Public TmpData As Variant
Code:
Option Explicit Private Sub Worksheet_Activate()
OldData = Range(Cells(1, 1), Cells(5, 5))
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
TmpData = Range(Cells(1, 1), Cells(5, 5))
If OldData = TmpData Then Newdata = Range(Cells(1, 1), Cells(5, 5))
End Sub
Code:
Watch : : OldData = TmpData : <type mismatch=""> : Variant/Integer : Sheet1.Worksheet_SelectionChange
</type>
Last edited: