kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
Hello All,
I have this macro that i use to print in my workbook. Instead of it printing from 1 always, i want it to use an inputbox to specify where to start from and where to end at. For example when i run it, it should ask me for entry for start ID and end ID. Thanks
I have this macro that i use to print in my workbook. Instead of it printing from 1 always, i want it to use an inputbox to specify where to start from and where to end at. For example when i run it, it should ask me for entry for start ID and end ID. Thanks
Code:
Sub Print()
Dim CountIt, IdNum As Long
CountIt = Application.InputBox("How many IDs do you wanna print?", Type:=1)
For IdNum = 1 To CountIt
With ActiveSheet
.Range("G6").Value = IdNum
.PrintOut
End With
Next IdNum
End Sub