LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default range object error

I'm using Excel 2000, and trying to modify a range name within VBA. When I
try code such as this -

Dim row, col as integer

row = 1
col = 1

ActiveWorkbook.Names.Add Name:="WHData", _
RefersTo:= Range(Cells(row, col), Cells(row + UBound(MyArray) - 1, col +
3))

I get 1004 Application-defined or object-defined error. I have confirmed
that UBound(MyArray) is defined, and in my code I have logic that changes
the values of row and col.

To test, I used the following, and did not get this error -

ActiveWorkbook.Names.Add Name:="WHData", RefersTo:= Range("A1:C5")


What am I missing to be able to use cells(rwindex, colindex) to set the range?

Thanks!

 
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
STUPID range object error Susan Excel Programming 3 May 8th 07 09:06 PM
Range Object error NoSoupForYou Excel Programming 9 October 26th 06 01:46 AM
peculiar error with Range() object Jeff[_42_] Excel Programming 2 July 2nd 06 09:36 PM
error 1004 Range object Tony James[_2_] Excel Programming 3 December 19th 05 03:11 PM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM


All times are GMT +1. The time now is 06:28 AM.

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"