relative cell address within any range

Viewed 30

i am trying to figure out how to get the relative cell address in any range, from its most top left cell address. Having checked ms documentation from https://docs.microsoft.com/en-us/office/vba/api/excel.range.address , i still can't get it.... it would always return me the absolute address.

 my_relative_address = Cells(anyRow, anyCol).Address
                MsgBox Cells(my_relative_address).Address(ReferenceStyle:=xlR1C1, _
                        RowAbsolute:=False, _
                        ColumnAbsolute:=False, _
                        RelativeTo:=Worksheets(1).Range(myRange))

I'd appreciate any suggestion. thanks.

0 Answers
Related