For example, the range C4:H9, a 6x6 range, if I were to have cell C5 selected and wanted to know that it was the 7th cell going from left to right, up to down, how could I easily determine that?
How to get the relative cell number within a range?
- browncoat
- Thread is marked as Resolved.
-
-
-
Hello,
What is your definition of " easily " ...???
To count the total number of cells in your range : =ROWS(C4:H9)*COLUMNS(C4:H9)
But, for the relative cell number, you will need VBA ... which might go against your definition of " easily " ...
-
-
Hello again,
Agree with pike
Although it seems to me ... UDF would be more in line with initial request ...
CodeFunction relative(rng As Range, c As Range) ' UDF to get Relative Cell Number in Range Dim r As Range, n As Long For Each r In rng n = n + 1 If c.Address = r.Address Then relative = n Next r End Function
Hope this will help
-
Very true,, i'm a bit rusty
-
Very true,, i'm a bit rusty
Let me doubt it ... !!!
The rabbit is well known for his ability to run very fast ...
-
Thanks, was looking for a VBA solution. I wasnt sure if there was already a built in way to determine this. Thanks.
-
Resolved
-
Thanks for your Thanks
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!