I am new to VBA and I would really appreciate help with the following:
- On button click I want documents to be printed each with a new date for all months in Cell A2.
The code below only updates the date once and the first date is the current date. (I need the first document to be printed not with the current date but the first date of the month.)
So when the first document is printed cell A2 has the first date of the month and the last document has the last date of the month printed.
Thanks in advance!
Private Sub CommandButton1_Click()
Range("A2").Value = Format(Date, "dd MMMM yy")
ActiveWindow.SelectedSheets.PrintOut copies:=1, collate:=True
Range("A2").Value = Range("A2").Value + 1
ActiveWindow.SelectedSheets.PrintOut copies:=1, collate:=True
End Sub