Need a bit of help here if possible I am new to VBA. I have been searching the "Excel Questions" but can't seem to find any clues. All this is supposed to do is to select a cell and if empty paste in the date/time but I keep geting Compile error where am I going wrong. Many thanks Mike54.
Private Sub CommandButton1_Click()
Dim X As Integer
Dim Y As Integer
X = 2
Y = 2
Cells(X, Y).Select
If Cells.Value = "" Then Cells(X, Y).Value = Now() Else: X = X + 1
End If
End Sub
Private Sub CommandButton1_Click()
Dim X As Integer
Dim Y As Integer
X = 2
Y = 2
Cells(X, Y).Select
If Cells.Value = "" Then Cells(X, Y).Value = Now() Else: X = X + 1
End If
End Sub