Offset behavior - 0/1 bug?
IainDM opened this issue · comments
IainDM commented
suppose I have a variable Range baseRange, which points to cell E10. Then baseRange.Offset[0,0] should also point to E10. But it points to D9.
Jozef Izso commented
Indexing in macros, Visual Basic and Office APIs are 1 based.
IainDM commented
Yes, I agree, that's true for indexes for methods like Cell[x,y]. But not for Offset.
For example:
Using the Office Interop Assemblies, Range["A1"].Offset[0, 0].Address = "$A$1"
In VBA, MsgBox Range("b5").Offset(0, 0).Address shows a message box with $B$5
IainDM commented
See also VBA help: https://learn.microsoft.com/en-us/office/vba/api/Excel.Range.Offset
Jozef Izso commented
IainDM commented
@jozefizso thank you.