ChristineJ
Well-known Member
- Joined
- May 18, 2009
- Messages
- 761
- Office Version
- 365
- Platform
- Windows
I have a variable named addresses that returns cell addresses, such as J11, A1, B3 or M5, W16, C121, X55, F99
I'd like to add code to offset each of these cell addresses. If offset one row and one column, J11, A1, B3 would instead be K12, B2, C4. The number of rows and columns that it would offset would vary.
I had been using a function that one of the members provided for when the cell addresses string appeared as a cell value.
I'd like to get the same result for when that cell addresses string is stored in a variable. Thanks!
I'd like to add code to offset each of these cell addresses. If offset one row and one column, J11, A1, B3 would instead be K12, B2, C4. The number of rows and columns that it would offset would vary.
I had been using a function that one of the members provided for when the cell addresses string appeared as a cell value.
I'd like to get the same result for when that cell addresses string is stored in a variable. Thanks!
Code:
Function MCELL(r As Long, c As Long, rng As String) As String
MCELL = Range(rng).Offset(r, c).Address(0, 0)
End Function
Offset cell addresses
Cell T31 = E9, X5, A1 I am using the following formula in cell U31 to add two column letters and one row to each cell reference in T31: =IF(T31="","",SUBSTITUTE(TEXTJOIN(", ",1,@CELL("address",OFFSET(INDIRECT(TRIM(MID(SUBSTITUTE(T31,", ",REPT("...
www.mrexcel.com