Hello,
I am hoping for some expert help please.
I have a following code:
I would like to insert a loop which would allow me to print sheets named 01 - 31 corresponding to start date in cell F4 and running the loop 13 times to get two weeks worth of reports. Basically, my worksheet Report is summary of 14 different pages which I would like to print along with the report as backup. Since the date changes, I'd like macro to select only those sheets that are relevant. There is one catch that i'm having trouble with... the report sometimes starts with last months date or ends with next months date. I need the loop to recognize these and omit from printing.
Thank you so much for your help...
I am hoping for some expert help please.
I have a following code:
Code:
Private Sub CommandButton1_Click()
Dim oSheet As Worksheet
Application.ScreenUpdating = False
Set oSheet = ActiveSheet
Worksheets("Report").Select
ExecuteExcel4Macro "PRINT()"
Application.ScreenUpdating = True
oSheet.Select
Set oSheet = Nothing
Unload Me
End Sub
I would like to insert a loop which would allow me to print sheets named 01 - 31 corresponding to start date in cell F4 and running the loop 13 times to get two weeks worth of reports. Basically, my worksheet Report is summary of 14 different pages which I would like to print along with the report as backup. Since the date changes, I'd like macro to select only those sheets that are relevant. There is one catch that i'm having trouble with... the report sometimes starts with last months date or ends with next months date. I need the loop to recognize these and omit from printing.
Thank you so much for your help...