Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Invalid Range Name | Excel Discussion (Misc queries) | |||
Invalid Name Range | Excel Discussion (Misc queries) | |||
VBA Range definition: Code needed | Excel Discussion (Misc queries) | |||
variable range definition | Excel Programming | |||
Using Cells( ) for Range definition | Excel Programming |