Help with runtime error 424 Object required

L

Little Penny

I get this error on this line of code


Range("J80").Select = p




Sub doprint()
'
' doprint Macro


Dim i As Integer
Dim oCell As Range
Dim cCell As Range
Dim p As Long

strjobnumber = InputBox("Start in Job Number?", " First Job to
Print", 0)
endjobnumber = InputBox("Finish in Job Number?", " Last Job to
Print", 0)

Range("I40").Select
Range("I41").Select


For Counter = strjobnumber To endjobnumber
Application.ScreenUpdating = False
Sheets("Pieces").Activate
Range("L5").Value = Counter
Range("J80").Select = p
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
Next Counter
Sheets("Pieces").Activate
Range("$A$1").Select

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top