I'm using VBA for EXCEL.
I'm also new to using it and this board.
All I'm trying to accomplish is that when a user inputs his/her initials in cell D5 the current time plus 1 hour will be inputted in C5.
I do this repetitively until cells o62 and P62.
I have repeated my code below to do this but I get the compile error.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Sundays Time
If Target.Address = Me.Range("d5").Address Then
Me.Range("c5") = Format(Now + 1 / 24)
End If
If Target.Address = Me.Range("d6").Address Then
Me.Range("c6") = Format(Now + 1 / 24)
End If
If Target.Address = Me.Range("d7").Address Then
Me.Range("c7") = Format(Now + 1 / 24)
End If
If Target.Address = Me.Range("d8").Address Then
Me.Range("c8") = Format(Now + 1 / 24)
End If
etc.. etc.. SO how can I combat this.
Thank you all in advance
StingerJ
I'm also new to using it and this board.
All I'm trying to accomplish is that when a user inputs his/her initials in cell D5 the current time plus 1 hour will be inputted in C5.
I do this repetitively until cells o62 and P62.
I have repeated my code below to do this but I get the compile error.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Sundays Time
If Target.Address = Me.Range("d5").Address Then
Me.Range("c5") = Format(Now + 1 / 24)
End If
If Target.Address = Me.Range("d6").Address Then
Me.Range("c6") = Format(Now + 1 / 24)
End If
If Target.Address = Me.Range("d7").Address Then
Me.Range("c7") = Format(Now + 1 / 24)
End If
If Target.Address = Me.Range("d8").Address Then
Me.Range("c8") = Format(Now + 1 / 24)
End If
etc.. etc.. SO how can I combat this.
Thank you all in advance
StingerJ