#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Run-time Error '9'

Run-time Error '9': Subscript out of range

This error keeps appearing when I try to set up the print function command
button. I have used the same exact code on other worksheets in the same
workbook (I just changed the worksheet name) and have not had any problems.
The first line of the code is highlighted when I debug.

Private Sub CommandButton1_Click()
Sheets("Application").PageSetup.PrintArea =
Sheets("Application").Range("$a$1:$j$39").Address
Sheets("Application").PrintOut Copies:=1
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Run-time Error '9'

Maybe you don't have a sheet called Application. Check that it doesn't have
leading/trailing space(s).

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"mbing916" wrote in message
...
Run-time Error '9': Subscript out of range

This error keeps appearing when I try to set up the print function command
button. I have used the same exact code on other worksheets in the same
workbook (I just changed the worksheet name) and have not had any
problems.
The first line of the code is highlighted when I debug.

Private Sub CommandButton1_Click()
Sheets("Application").PageSetup.PrintArea =
Sheets("Application").Range("$a$1:$j$39").Address
Sheets("Application").PrintOut Copies:=1
End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
run-time error '91'-Close Button error ASCO IS Help Excel Discussion (Misc queries) 1 May 8th 06 04:25 PM
run time error nuti Excel Discussion (Misc queries) 0 January 18th 06 10:45 AM
Run-Time Error 424 Jeff Excel Discussion (Misc queries) 2 October 7th 05 01:57 AM
Help Error Run-time Error 424 Jeff Excel Discussion (Misc queries) 0 October 6th 05 08:17 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM


All times are GMT +1. The time now is 09:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"