Function AddressReferenceStyle(CellAddress, Optional ChangeTo_R1C1 = 1)
' Change the cell address from A4 to R4C1
' Or from R4C1 to A4
' ChangeTo_R1C1 = 1 to change from A4 to R4C1
' ChangeTo_R1C1 = 0 to change R1C1 to A1 style
'
Rett = CellAddress
If ChangeTo_R1C1 = 1 Then
Rett = Range(CellAddress).Address(1, 1, xlR1C1)
Else
Ro = Val(CutString(CellAddress, "R", "C", 1))
Co = Val(CutString(CellAddress, "C", "", 1))
If Ro > 0 And Co > 0 Then Rett = Cells(Ro, Co).Address(1, 1, xlA1)
End If
AddressReferenceStyle = Rett
End Function
' Change the cell address from A4 to R4C1
' Or from R4C1 to A4
' ChangeTo_R1C1 = 1 to change from A4 to R4C1
' ChangeTo_R1C1 = 0 to change R1C1 to A1 style
'
Rett = CellAddress
If ChangeTo_R1C1 = 1 Then
Rett = Range(CellAddress).Address(1, 1, xlR1C1)
Else
Ro = Val(CutString(CellAddress, "R", "C", 1))
Co = Val(CutString(CellAddress, "C", "", 1))
If Ro > 0 And Co > 0 Then Rett = Cells(Ro, Co).Address(1, 1, xlA1)
End If
AddressReferenceStyle = Rett
End Function
CellAddress, Optional ChangeTo_R1C1 = 1
Views 141
Downloads 57
CodeID
DB ID