tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,924
- Office Version
- 365
- 2019
- Platform
- Windows
Assume I have the value of 1 in cell A1, 2 in B1, 3 in C1, 4 in A2, 5 in B2 and 6 in C2.
This is my code:
If I type:
I get a value of 3, as expected.
However, why is it when I type:
I get a value of 4.
I expected it to error because Rng is set to be the range A1 to C1 only.
Thanks
This is my code:
Code:
Dim Rng As Range
Set Rng = Range("A1:C1")
If I type:
Code:
Debug.Print Rng(1)
I get a value of 3, as expected.
However, why is it when I type:
Code:
Debug.Print Rng(4)
I get a value of 4.
I expected it to error because Rng is set to be the range A1 to C1 only.
Thanks