![]() |
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. |
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. |
All times are GMT +1. The time now is 03:40 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com