I use this print macro to send a line of data from my spreadsheet to a form and then the printer. It works fine in the one spreadsheet, but I have numerous sheets (monthly) in the workbook and my problem is that it won't work on any of the other sheets other than the one it is created in.
My question is how to make this work for all worksheets in the workbook. Thank you for any advice.
I will post the 'error' part of it below the actual macro to maybe help you troubleshoot!
Carl
..... the error that comes up when I try to print on a different sheet in the workbook (highlights in yellow and can't get past) is as follows:
ActiveCell.Offset(0, -1).Range( _
"Table1[[#Headers],[Article Number]:[Claimed By]]").Select
My question is how to make this work for all worksheets in the workbook. Thank you for any advice.
I will post the 'error' part of it below the actual macro to maybe help you troubleshoot!
Carl
Code:
Sub Print2018()
'
' Print2018 Macro
' Claimed Item Receipt. Place the cursor in the Found Item field prior to printing!
'
'
ActiveCell.Offset(0, -1).Range( _
"Table1[[#Headers],[Article Number]:[Claimed By]]").Select
Selection.Copy
Sheets(".").Select
ActiveSheet.Paste
Application.CutCopyMode = False
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.Rows.AutoFit
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
Selection.ClearContents
Sheets("Jun 2018").Select
ActiveCell.Offset(0, 1).Range("Table1[[#Headers],[Article Number]]").Select
End Sub
..... the error that comes up when I try to print on a different sheet in the workbook (highlights in yellow and can't get past) is as follows:
ActiveCell.Offset(0, -1).Range( _
"Table1[[#Headers],[Article Number]:[Claimed By]]").Select
Last edited by a moderator: