K
kdev
I am looking to print X copies of a single sheet using VBA. The numbe
of copies (X) is entered into a cell on the Home worksheet and th
module gets this value and stores it in the variable prtquant.
Getting the value from the Home sheet (in cell G23) works fine but a
error is thrown up in the sht.PrintOut line:
Run-time error '91':
Object variable or With block variable not set
I have set prtquant as an integer using the line:
Code
-------------------
Dim prtquant As Integer
-------------------
Code
-------------------
prtquant = Worksheets("Home").Range("G23").Value
sht.PrintOut Copies:=prtquant, Collate:=True
-------------------
Can anyone suggest a working solution?
Thanks
of copies (X) is entered into a cell on the Home worksheet and th
module gets this value and stores it in the variable prtquant.
Getting the value from the Home sheet (in cell G23) works fine but a
error is thrown up in the sht.PrintOut line:
Run-time error '91':
Object variable or With block variable not set
I have set prtquant as an integer using the line:
Code
-------------------
Dim prtquant As Integer
-------------------
Code
-------------------
prtquant = Worksheets("Home").Range("G23").Value
sht.PrintOut Copies:=prtquant, Collate:=True
-------------------
Can anyone suggest a working solution?
Thanks