Function R1C1converter(Address As String, Optional R1C1_output As Integer, Optional RefCell As Range) As String
Dim x As Variant
If RefCell Is Nothing Then Set RefCell = ActiveCell
If R1C1_output = xlR1C1 Then
x = Application.ConvertFormula(Address, xlA1, xlR1C1, , RefCell)
Else
x = Application.ConvertFormula(Address, xlR1C1, xlA1, , RefCell)
End If
If IsError(x) Then
R1C1converter = Address
Else
If Right(x, 1) = "'" Then
R1C1converter = Mid(x, 2, Len(x) - 2)
Else
R1C1converter = x
End If
End If
End Function
|