Wagsbags83
New Member
- Joined
- Apr 21, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Good Morning All,
I am really somewhat new with using macro's and VBA in excel sheets.
Currently I have a macro that I recorded that looks like the following.
Sub PrintAttempt()
'
' PrintAttempt Macro
' Print Labels
'
'
ActiveCell.FormulaR1C1 = "1"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
ActiveCell.FormulaR1C1 = "2"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
ActiveCell.FormulaR1C1 = "3"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
ActiveCell.FormulaR1C1 = "4"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
ActiveCell.FormulaR1C1 = "5"
Range("B3").Select
End Sub
Basically this enters the number 1 in cell B1 which then pulls a bunch of information from the sheet Database and prints. Then replaces 1 with 2 and pulls that info and prints.
I am trying to figure out how to get the macro to stop when it reaches a number that pulls no information.
Any help would be greatly appreciated.
Thanks,
Chris
I am really somewhat new with using macro's and VBA in excel sheets.
Currently I have a macro that I recorded that looks like the following.
Sub PrintAttempt()
'
' PrintAttempt Macro
' Print Labels
'
'
ActiveCell.FormulaR1C1 = "1"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
ActiveCell.FormulaR1C1 = "2"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
ActiveCell.FormulaR1C1 = "3"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
ActiveCell.FormulaR1C1 = "4"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
ActiveCell.FormulaR1C1 = "5"
Range("B3").Select
End Sub
Basically this enters the number 1 in cell B1 which then pulls a bunch of information from the sheet Database and prints. Then replaces 1 with 2 and pulls that info and prints.
I am trying to figure out how to get the macro to stop when it reaches a number that pulls no information.
Any help would be greatly appreciated.
Thanks,
Chris