I am trying to set up a dynamic print range to print a sheet in a work book that is populated from another sheet in the same workbook. I seem to be having trouble. I set up a named range in Name Manager called lateral as follows:
=OFFSET('Slide Sheet Print Lateral'!$A$27, 0, 0, COUNTA('Slide Sheet Print Lateral'!$A:$A), COUNTA('Slide Sheet Print Lateral'!$1:$1))
I can't seem to make that work for some reason.
I am stuck trying to write the VBA code ( I know nothing about VBA) I have this that I recorded, I have the sheet hidden that I want to print it unhides it and then rehides it.
Sub PrintSlideSheetLat()
'
' PrintSlideSheet Lateral Macro
'
'
Sheets("Slide Sheet Lateral").Select
Sheets("Slide Sheet Print Lateral").Visible = True
Sheets("Slide Sheet Print Lateral").Select
ActiveSheet.PageSetup.Printarea = "lateral" ///ERROR on this line
ActiveWindow.SmallScroll Down:=-201
Range("D14").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Range("D14").Select
Sheets("Slide Sheet Lateral").Select
Range("Q10:S10").Select
Sheets("Slide Sheet Print Lateral").Select
ActiveWindow.SelectedSheets.Visible = False
End Sub
Basically I want it to print from A through to N if there is a value in Column A if there is no value in A then print up to the line that is blank
I get an error "Run Time Error '1004'" on
sorry for all the #REF errors in attachement, had to delete a bunch of pages so it was small enough to upload
Can anyone help?
Moderator's Note: Welcome to the forum, don't forget to put code tags on codes, Select the code then Hit the "#" sign. Thank you.
Bookmarks