L
Little Penny
I'm trying to replace my input boxes the custom forms. I have created
the form. I just don't know how to take the value inputted and get it
to my existing code.
Custom form code.
Private Sub cmdClose_Click()
' This Unloads the Address form and
' makes the address worksheet the
' active window.
Unload Me
Sheets("Pieces").Activate
End Sub
Private Sub cmdOK_Click()
End Sub
' Current code with input boxes
Sub doprint()
'
' doprint Macro
Dim i As Integer
Dim oCell As Range
Dim cCell As Range
Dim p As Long
strjobnumber = Application.InputBox("Start in Job Number?", "
First Job to Print", 0)
If strjobnumber = False Then Exit Sub
endjobnumber = Application.InputBox("Finish in Job Number?", "
Last Job to Print", 0)
If endjobnumber = False Then Exit Sub
Range("I40").Select
Range("I41").Select
For counter = strjobnumber To endjobnumber
Application.ScreenUpdating = False
Sheets("Pieces").Activate
Range("L5").Value = counter
Range("J85").Select
c = ActiveCell.Value
If c < 100 Then GoTo NextCounter
Range("J80").Select
p = ActiveCell.Value
Sheets(Array("BatchSheet1", "BatchSheet2", "BatchSheet3",
"BatchSheet4", _
"BatchSheet5", "BatchSheet6", "BatchSheet7", "BatchSheet8",
"BatchSheet9", _
"BatchSheet10", "BatchSheet11", "BatchSheet12",
"BatchSheet13", "BatchSheet14", _
"BatchSheet15", "BatchSheet16", "BatchSheet17",
"BatchSheet18", "BatchSheet19", _
"BatchSheet20")).Select
Sheets("BatchSheet1").Activate
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=p,
Copies:=1, Collate _
:=True
Application.ScreenUpdating = True
NextCounter:
Next counter
Sheets("Pieces").Activate
Range("$A$1").Select
End Sub
the form. I just don't know how to take the value inputted and get it
to my existing code.
Custom form code.
Private Sub cmdClose_Click()
' This Unloads the Address form and
' makes the address worksheet the
' active window.
Unload Me
Sheets("Pieces").Activate
End Sub
Private Sub cmdOK_Click()
End Sub
' Current code with input boxes
Sub doprint()
'
' doprint Macro
Dim i As Integer
Dim oCell As Range
Dim cCell As Range
Dim p As Long
strjobnumber = Application.InputBox("Start in Job Number?", "
First Job to Print", 0)
If strjobnumber = False Then Exit Sub
endjobnumber = Application.InputBox("Finish in Job Number?", "
Last Job to Print", 0)
If endjobnumber = False Then Exit Sub
Range("I40").Select
Range("I41").Select
For counter = strjobnumber To endjobnumber
Application.ScreenUpdating = False
Sheets("Pieces").Activate
Range("L5").Value = counter
Range("J85").Select
c = ActiveCell.Value
If c < 100 Then GoTo NextCounter
Range("J80").Select
p = ActiveCell.Value
Sheets(Array("BatchSheet1", "BatchSheet2", "BatchSheet3",
"BatchSheet4", _
"BatchSheet5", "BatchSheet6", "BatchSheet7", "BatchSheet8",
"BatchSheet9", _
"BatchSheet10", "BatchSheet11", "BatchSheet12",
"BatchSheet13", "BatchSheet14", _
"BatchSheet15", "BatchSheet16", "BatchSheet17",
"BatchSheet18", "BatchSheet19", _
"BatchSheet20")).Select
Sheets("BatchSheet1").Activate
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=p,
Copies:=1, Collate _
:=True
Application.ScreenUpdating = True
NextCounter:
Next counter
Sheets("Pieces").Activate
Range("$A$1").Select
End Sub