Im a complete VBA noob and im trying to do what seems to be a simple thing.
The purpose of my code is to make a button where it checks to see if the cell is not empty, it should offset to the next column and if it is empty, then it should add todays date.
So each day I press the button it adds a new date next to the old one.
Here is the code I wrote:
Private Sub New_Date_Click()
ActiveSheet.Range("E1").Select
If Not IsEmpty(ActiveCell.Value) Then
ActiveCell.Offset(0,1)
Else
ActiveCell.Value = Date
End Sub
It gives me an error message that an Equal sign is missing on row 4 where the offset is.
The images show what im trying to do.
The purpose of my code is to make a button where it checks to see if the cell is not empty, it should offset to the next column and if it is empty, then it should add todays date.
So each day I press the button it adds a new date next to the old one.
Here is the code I wrote:
Private Sub New_Date_Click()
ActiveSheet.Range("E1").Select
If Not IsEmpty(ActiveCell.Value) Then
ActiveCell.Offset(0,1)
Else
ActiveCell.Value = Date
End Sub
It gives me an error message that an Equal sign is missing on row 4 where the offset is.
The images show what im trying to do.