I was wondering if anyone could tell me why this code doesn't work? I'm just playing around with some codes to see what can work.
Private Sub CommandButton1_Click()![]()
Please Login or Register to view this content.
myRng = Range("a1", Range("a1").End(xlDown)).value
If myRng = 2 Then
MsgBox ("yes")
End If
End SubThe following code does work![]()
Please Login or Register to view this content.
Range("a1", Range("a1").End(xlDown)).value = 2![]()
Please Login or Register to view this content.
This sets the whole range of cells to 2, so why can't you call an IF statement to see what the value is?
Alex
Bookmarks