Actually, I just solved my problem, or at least I figured out how to handle it and will need more coding to handle multiple name ranges. To begin with completely ignore the code in the original post. I do not need it.
In the Name Manager, I changed the Refers To to
Then on sheet1 in cells 254B, C, and D, I placed the following strings:
'cell 254B is =
sheet1!$E$2:$E$41
'cell 254C is =
sheet1!$E$2:$E$41
'and cell 254D is =
sheet1!$E$52:$E$91
Then I created the following sub routine
Sub IndirectFormula()
Dim ReferToString As String
ReferToString = Sheets("Code").Range("B254").Value
'Swap code lines for Indirect access from Name Manager
If ReferToString = Sheets("Code").Range("C254").Value Then
Sheets("Code").Range("B254").Value = Sheets("Code").Range("D254").Value
ElseIf ReferToString = Sheets("Code").Range("D254").Value Then
Sheets("Code").Range("B254").Value = Sheets("Code").Range("C254").Value
End If
End Sub
So I can change the value for the named range in Name Manager on the fly with the simple code above.
This is the main problem I was trying to resolve. Now I have more code to right, since by the time I am through, I will have approximately 156 code lines to index along with 156 INDIRECT entries in Name Manager. This should be fun!
*** Note: In my code, I refer to sheet1 as code
Bookmarks