Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Return the row numbers or a dynamic range in VBA
Hello, I have finally figured out how to create a dynamic range and it works
great. Now I need to query this dynamic range to determine the row numbers of the first and last rows of the range. Example: I have a dynamic range named Range_6. Being dynamic in nature, this range changes frequently. What I need to know is how can I query this "Range_6" range to retrieve only its beginning row number and ending row number? If I have a dynamic range that equates to D11:D142 - using VBA, how can I query Range_6 to get just the 11 and 142 part? I don't need to select the range "Range(range_6).Select", just return the row numbers? Hope that makes sense!! Thanks Jim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Return the row numbers or a dynamic range in VBA
Jim,
The first row: MsgBox Range("Range_6").Row The last row: MsgBox Range("Range_6").Cells(Range("Range_6").Cells.Coun t).Row HTH, Bernie MS Excel MVP "Jim" <. wrote in message ... Hello, I have finally figured out how to create a dynamic range and it works great. Now I need to query this dynamic range to determine the row numbers of the first and last rows of the range. Example: I have a dynamic range named Range_6. Being dynamic in nature, this range changes frequently. What I need to know is how can I query this "Range_6" range to retrieve only its beginning row number and ending row number? If I have a dynamic range that equates to D11:D142 - using VBA, how can I query Range_6 to get just the 11 and 142 part? I don't need to select the range "Range(range_6).Select", just return the row numbers? Hope that makes sense!! Thanks Jim |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Return the row numbers or a dynamic range in VBA
Set rng = Range("myRange") FirstRow = rng.Row lastRow = rng(rng.Count).Row -- HTH Bob Phillips "Jim" <. wrote in message ... Hello, I have finally figured out how to create a dynamic range and it works great. Now I need to query this dynamic range to determine the row numbers of the first and last rows of the range. Example: I have a dynamic range named Range_6. Being dynamic in nature, this range changes frequently. What I need to know is how can I query this "Range_6" range to retrieve only its beginning row number and ending row number? If I have a dynamic range that equates to D11:D142 - using VBA, how can I query Range_6 to get just the 11 and 142 part? I don't need to select the range "Range(range_6).Select", just return the row numbers? Hope that makes sense!! Thanks Jim |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Return the row numbers or a dynamic range in VBA
Outstanding!! Thanks Bob and Bernie, both your suggestions worked GREAT!
This was really busting my chops. Thanks so much!!! Jim "Jim" <. wrote in message ... Hello, I have finally figured out how to create a dynamic range and it works great. Now I need to query this dynamic range to determine the row numbers of the first and last rows of the range. Example: I have a dynamic range named Range_6. Being dynamic in nature, this range changes frequently. What I need to know is how can I query this "Range_6" range to retrieve only its beginning row number and ending row number? If I have a dynamic range that equates to D11:D142 - using VBA, how can I query Range_6 to get just the 11 and 142 part? I don't need to select the range "Range(range_6).Select", just return the row numbers? Hope that makes sense!! Thanks Jim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Return the 2 lowest numbers within a range | Excel Worksheet Functions | |||
addup up a dynamic range of numbers in a column | Excel Discussion (Misc queries) | |||
addup up a dynamic range of numbers in a column | Excel Worksheet Functions | |||
lookup range of numbers; return corresponding data for the fixed r | Excel Worksheet Functions | |||
How to return a single value for a range of numbers | Excel Worksheet Functions |