Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Subscript out of Range on Range reference

Subscript out of range means you don't have a worksheet named "Sheet1"

In the second example, subscript out of range would mean the same - no
Sheet1, but eventually, if you clear that up, you will get an error if the
named sheet is not the activesheet.
With Worksheets("Sheet1")
set rng = .Range(.Cells(1, 1), .Cells(5, 5))
End With

--
Regards,
Tom Ogilvy




paul reed wrote in message
...
Hello,

I have spreadsheet and I am building a macro in the VB Editor. Whenever I
try to reference a range likes this:

Worksheets("Sheet1").Range("A6:D10")

or like this...

Worksheets("Sheet1").Range(Cells(1, 1), Cells(5, 5))

I get a subscript out of range...there is definitely data in those cells

for
sure. I am do a lot of programming...but this one is not obvious to me for
some reason.

Thanks in advace,

Paul




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
Subscript out of range OKHM Excel Discussion (Misc queries) 0 August 6th 09 05:18 PM
Subscript out of Range Steve Excel Discussion (Misc queries) 3 April 15th 09 04:01 PM
what does 'Subscript Out of range' mean?? Gary Excel Worksheet Functions 2 March 22nd 07 01:33 AM
9: Subscript out of range jenz21985 Excel Discussion (Misc queries) 6 May 5th 06 03:36 PM
Subscript Out of Range John Wilson Excel Programming 2 September 7th 03 04:07 AM


All times are GMT +1. The time now is 10:19 PM.

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

About Us

"It's about Microsoft Excel"