Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a named range called "Versions" and it's located in "A10:A15". When I select Range "A12" I get 12, when I use ActiveCell.Row. What I'd like to know is the relative row in Range "Versions", which would be 3. What' s the syntax for it? Thanks. Regards Werner Excel XP SP3 Win XP SP1 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub marine()
MsgBox (ActiveCell.Row - Range("Versions").Row + 1) End Sub -- Gary''s Student - gsnu2007g |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe?
MsgBox ActiveCell.Row - Range("d5:d10").Cells(1).Row+1 -- Don Guillett Microsoft MVP Excel SalesAid Software "Werner Rohrmoser" wrote in message ... Hello, I have a named range called "Versions" and it's located in "A10:A15". When I select Range "A12" I get 12, when I use ActiveCell.Row. What I'd like to know is the relative row in Range "Versions", which would be 3. What' s the syntax for it? Thanks. Regards Werner Excel XP SP3 Win XP SP1 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would check the active cell is in the named range first
Sub sonic() If Intersect(ActiveCell, Range("versions")) Is Nothing Then MsgBox "The selected cell is not in the named range" Else With Range("versions") irownumber = .Row End With MsgBox ActiveCell.Row - irownumber+1 End If End Sub Mike "Werner Rohrmoser" wrote: Hello, I have a named range called "Versions" and it's located in "A10:A15". When I select Range "A12" I get 12, when I use ActiveCell.Row. What I'd like to know is the relative row in Range "Versions", which would be 3. What' s the syntax for it? Thanks. Regards Werner Excel XP SP3 Win XP SP1 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for all the suggestions.
Werner |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using named range to extend print area for variable number of columns | Excel Worksheet Functions | |||
Last Row Number in a Named Range | Excel Worksheet Functions | |||
VBA: find number of columns in named range? | Excel Discussion (Misc queries) | |||
Number of Rows & Columns in a Named Range | Excel Discussion (Misc queries) | |||
How to count number of pages in a named range | Excel Programming |