Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default How come this range definition is invalid?

Hi Thanks

cells(5,icol) has no defined parent.

un unspecified Range's parent whould default to _Global being the
Activesheet in Activeworkbook

for cells it won't work, but you might do it like

With worksheets("Boasting")
set rngCumAMile = .range(.cells(5,icol),.cells(22,icol))
end with

<bg

Greetz, All

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"?B?bHV2Z3JlZW4=?=" wrote:

Greetings all.

I got the error "Application-defined or object-defined error" of the
range definition below.

Set rngCumMile = Worksheets("Individual View").Range(Cells(5, iCol),
Cells(22, iCol))

Any advice? Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default How come this range definition is invalid?

Another way to avoid the problem is

Set rng = Worksheets("Individual View").Range("A1")

after which you can use

Set rngCumMile = Range(rng(5, iCol), rng(22, iCol))

Alan Beban

luvgreen wrote:

Thank you KeepITCool. I found that if I activate the sheet first, it will take my line of code. I will keep your suggestion in mind.

"keepITcool" wrote:


Hi Thanks

cells(5,icol) has no defined parent.

un unspecified Range's parent whould default to _Global being the
Activesheet in Activeworkbook

for cells it won't work, but you might do it like

With worksheets("Boasting")
set rngCumAMile = .range(.cells(5,icol),.cells(22,icol))
end with

<bg

Greetz, All

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"?B?bHV2Z3JlZW4=?=" wrote:


Greetings all.

I got the error "Application-defined or object-defined error" of the
range definition below.

Set rngCumMile = Worksheets("Individual View").Range(Cells(5, iCol),
Cells(22, iCol))

Any advice? Thanks.



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
Invalid Range Name Debbie Excel Discussion (Misc queries) 0 November 17th 08 04:48 PM
Invalid Name Range Edwin Kelly Excel Discussion (Misc queries) 4 March 9th 07 04:51 PM
VBA Range definition: Code needed David B Excel Discussion (Misc queries) 8 September 25th 06 06:40 PM
variable range definition jmp Excel Programming 2 May 6th 04 11:06 PM
Using Cells( ) for Range definition [email protected] Excel Programming 5 September 2nd 03 08:04 PM


All times are GMT +1. The time now is 10:39 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"