Let's Say I'm preparing a UDF which involves something with ranges. Now consider this piece of code
The problem with this is it returns Rng does not store it as range, but instead returns #VALUE error.
So, if I wanted to set a range in UDF say from $A$1:B4, how would I proceed ?
Note that even if the Var 1 is A1 instead of $A$1 it returns the same error.
Thank you for your help.
Code:
Dim Var1 As String
Dim Var2 As String
Dim Rng As Range
Var1 = "$A$1"
Var2 = "B4"
Rng = Range(Var1, Var2)
The problem with this is it returns Rng does not store it as range, but instead returns #VALUE error.
So, if I wanted to set a range in UDF say from $A$1:B4, how would I proceed ?
Note that even if the Var 1 is A1 instead of $A$1 it returns the same error.
Thank you for your help.