selfteaching
03-09-2019, 04:53 PM
Hi
I set up a spreadsheet with data and print numbers.
I have a Userform that will print certain page numbers
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
Sheets("Sheet1").Select
Select Case Me.ListBox1.Value
Case Is = "A": ActiveSheet.PrintOut From:=4, To:=6, Copies:=1
Case Is = "B": ActiveSheet.PrintOut From:=7, To:=9, Copies:=1
Case Is = "C": ActiveSheet.PrintOut From:=10, To:=11, Copies:=1
Case Is = "D": ActiveSheet.PrintOut From:=13, To:=15, Copies:=1
Case Is = "E": ActiveSheet.PrintOut From:=16, To:=18, Copies:=1
Case Is = "F": ActiveSheet.PrintOut From:=19, To:=21, Copies:=1
Case Is = "G": ActiveSheet.PrintOut From:=22, To:=23, Copies:=1
........
I'm trying to add an input (text) box to be able to print only a particular number
the user would put in the number that is needed to print.
The way it works now is if ,as an example, the user needs printout >> 5, 4,5,and 6 gets printed
I thought about making 23 list boxes and adapting the above code, but would like to make it easier for me, and learn somethi
mike
I set up a spreadsheet with data and print numbers.
I have a Userform that will print certain page numbers
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
Sheets("Sheet1").Select
Select Case Me.ListBox1.Value
Case Is = "A": ActiveSheet.PrintOut From:=4, To:=6, Copies:=1
Case Is = "B": ActiveSheet.PrintOut From:=7, To:=9, Copies:=1
Case Is = "C": ActiveSheet.PrintOut From:=10, To:=11, Copies:=1
Case Is = "D": ActiveSheet.PrintOut From:=13, To:=15, Copies:=1
Case Is = "E": ActiveSheet.PrintOut From:=16, To:=18, Copies:=1
Case Is = "F": ActiveSheet.PrintOut From:=19, To:=21, Copies:=1
Case Is = "G": ActiveSheet.PrintOut From:=22, To:=23, Copies:=1
........
I'm trying to add an input (text) box to be able to print only a particular number
the user would put in the number that is needed to print.
The way it works now is if ,as an example, the user needs printout >> 5, 4,5,and 6 gets printed
I thought about making 23 list boxes and adapting the above code, but would like to make it easier for me, and learn somethi
mike