I want to be able to click a command button and the macro will open another work book and print the first 3 sheets in the new workbook
This is what I got so far
Private sub commandbutton_click()
If Range("A1").value=4 then
Workbooks.open "c:\work\april\ivan\dinner\reciepts.xlsm"
Workbooks(c:\work\april\ivan\dinner\reciepts.xlsm").worksheets(array("1","2","3","4")).printout
End sub
I get runtime error '9'
Subscript out of range
This is what I got so far
Private sub commandbutton_click()
If Range("A1").value=4 then
Workbooks.open "c:\work\april\ivan\dinner\reciepts.xlsm"
Workbooks(c:\work\april\ivan\dinner\reciepts.xlsm").worksheets(array("1","2","3","4")).printout
End sub
I get runtime error '9'
Subscript out of range