- i have a spreadsheet with data that changes in size so have created dynamic named ranges and the columns names also do change sometimes. So i have a formula that generate the name of columns based of a drop-down list. Would be easy if INDIRECT works with dynamic named ranges but it doesn't so i use a UDF(Getadd(D1) gets me the full address of dynamic named range (LayerData!$BK$2:$BK$100)
Inc_Excl Cat_Modelling_Inc_Excl YOA Exposure SI_Current Exposure SI_Proposed 112015134,011 134,011 112015612,376 612,376 112015196,113 196,113 112016196,113 196,113 11201412,763 12,763 112013255,260 255,260 112015191,445 191,445 112016102,104 102,104 11201338,289 38,289
VBA Code:
Function Getadd(rangeName As String) As Variant
Dim rng As Range
On Error Resume Next
Set rng = Evaluate(rangeName)
On Error GoTo 0
If Not rng Is Nothing Then
Getadd = "LayerData!" & rng.Address
Else
Getadd = "Named range not found or not dynamic."
End If
End Function
to get the sheet name and address of dynamic name, but when i use it in my SUMIFS, it returns a #VALUE because of double quotation marks (well i guess).
i tried to use SUBSTITUTE to get rid of the quotes but no dice. Been stuck on this for a day now so any help will be greatly appreciated