So I am creating a voice mail log for my department and when a teammate completes the task of returning a clients call they can click the button I have created and it will automatically fill in the current date and time for tracking purposes. Here is the code I am using:
Private Sub CommandButton1_Click()
With Sheets("Voicemail Log")
.Range("I3").Value = Date
.Range("I4").Value = Time
End With
End Sub
Problem is that is the code for one button and for one record. We have anywhere between 100 and 200 voice mails to return each month. Is there a way that I can copy the entire row to include the button and the VBA so that the next line will look like this:
Private Sub CommandButton1_Click()
With Sheets("Voicemail Log")
.Range("I5").Value = Date
.Range("I6").Value = Time
End With
End Sub
and so on all the way down? I know if I select the cell and grab the bottom right corner and drag it down it will copy the cells however the VBA does not come with it as I had hoped like a regular formula would.
Any help is much appreciated!
Bookmarks