User Input Boxes

lrowley

New member
Local time
Today, 13:49
Joined
Apr 25, 2012
Messages
1
I have this macro that prints records based on a range that the user specifies. The only problem is that I'm still (trying to!) learning and would like to know how the code can be written so that the input box with ".....Starting Record" appears before and not after the input box ".......End Record" which is what is happening at the moment.

VB:
Sub Print_All()
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim x As Variant
Dim v As Variant
v = InputBox("Please enter the Ending Record number")
For i = InputBox("Please enter the Starting Record number") To v
x = i
Range("n2").FormulaR1C1 = x
Sheets("Deskingsheet").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False

Next i
End Sub

Thanks in advance

Lee​
 
Code:
Dim x As Variant 
Dim v As Variant
Dim n as Variant
n = InputBox("Please enter the Starting Record number") 
v = InputBox("Please enter the Ending Record number") 
For i = n To v 
x = i
 

Users who are viewing this thread

Back
Top Bottom