1

As indirect() is volatile and there is no other way than using indirect in my files, I need to create a UDF equivalent/alternative to indirect.

As far as I have been is :

INDIRECTVBA(ref_text As String, Optional active_A1 As Boolean) As String
If active_A1 = False Then
    ref_text = "=" & ref_text
    ref_text = Application.ConvertFormula(Formula:=ref_text, fromReferenceStyle:=xlR1C1, toReferenceStyle:=xlA1)
    INDIRECTVBA = Range(ref_text)
Else
    INDIRECTVBA = Range(ref_text)
End If
End Function

At this point, I'm able to manage :

  • A1 and R1C1 input with A1 format as default,
  • In the same sheet or not,
  • With and without the name of sheet.

I have been googleing for hours, to go there ...

My final need is to handle range such as :

  • A1:B2 as ref_text => INDIRECTVBA("A1:B2") should return a range as A1:B2
  • R1C1:R2C3 as ref_text

Thanks for time,

ladislasHD
  • 11
  • 3

0 Answers0