Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well, if I understand what you are asking correctly, you could do the Set
operation this way... Set = Range("M5").Resize(Cells(Rows.Count, "M").End(xlUp).Row - 4) where the -4 comes from subtracting the start row of 5 and adding 1 because we want the count of rows and not just the difference of rows. -- Rick (MVP - Excel) "JMay" wrote in message ... Thanks Gary. Are there other options in this case? Jim "Gary''s Student" wrote: Almost the Sub UseRangeObject2() Set rng = Range("M5:M" & Cells(Rows.Count, "M").End(xlUp).Row) MsgBox rng.Address End Sub -- Gary''s Student - gsnu200909 "JMay" wrote: I'm familiar with setting an Object under UseRangeObject1() (first below) Sub UseRangeObject1() Lr = Range("M" & Rows.Count).End(xlUp).Row Set rng = Range("M5:M" & Lr) End Sub But can't one bypass getting the Lr as Follows? Currently no working - what is wrong with syntax? Sub UseRangeObject2() Set rng = Range("M5:M" & Rows.Count.End(xlUp).Row) End Sub TIA, Jim |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Object Library invalid or contains references to object defintions | Excel Programming | |||
2 Label Options - Forms Object vs Control Box Object | Excel Discussion (Misc queries) | |||
Can I get a chart object (excel.ChartObject) from OLE_chart.object | Excel Programming | |||
Option button object proeprties or object not found in vba | Excel Programming | |||
Confusion about how the Window object fits into the Excel object model | Excel Programming |