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()
myRng = Range("a1", Range("a1").End(xlDown)).value
If myRng = 2 Then
MsgBox ("yes")
End If
End SubThe following code does work
Range("a1", Range("a1").End(xlDown)).value = 2
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