It looks like you misunderstood PEH's intention. I am explaining and expanding on it. Here is a pictue of the worksheet he recommended you to cache.
You want to cache the range B2:D7 (or E7 in the future). Here is the code that does the caching.
Sub GetTemplateAddresses(AddList As Variant)
' loads AddList only if not already loaded
Dim Rng As Range ' Range of cached addresses table
Dim Rl As Long ' last used row in Ws "Cache"
If IsEmpty(AddList) Then ' skip if AddList is already set
With Worksheets("Cache") ' use your own name for this worksheet
Rl = .Cells(.Rows.Count, "A").End(xlUp).Row
' start from B2 to (LastRow of Template3)
Set Rng = .Range(.Cells(2, 2), .Cells(Rl, Ncc3 + 1))
AddList = Rng.Value
End With
End If
End Sub
Before you can call this sub you need to prepare a little. Observe that the sub has a parameter, AddList. The idea (courtesy @PEH) is that you don't need to cache it again if it's already cached. So, you supply the array variable and the code loads it only if it is blank.
The other preparation is the reference in the above code to enumeration Ncc3. The Enum is designed to enable easy addressing of the entire AddList array. Mind that it must be at the top of any standard code module, before any procedure on that sheet. Here is the full enumeration.
Option Explicit
Enum Ncc ' Array of Cached addresses
Ncc1 = 1 ' Template 1
Ncc2
Ncc3
NccFname = 1 ' assign integers only
NccMname ' if no value is assigned,
NccLname ' VBA assigns previous + 1
NccCity
NccStreet
NccZip
NccTel
NccEmail ' NccEmail = 8 (test with ? NccEmail in the Immediate window)
End Enum
I have designed a little testing procedure for you. Install it in a standard code module, why not below the above enumeration and above the sub it calls?
Private Sub TestGetAdd()
Dim AddList As Variant
Dim TemplateNumber As Ncc, FieldName As Ncc
GetTemplateAddresses AddList
TemplateNumber = Ncc2 ' change the numbers for testing
FieldName = NccStreet ' the press F5
MsgBox "You have entered template No. " & TemplateNumber & vbCr & _
"and specified field No. " & FieldName & String(2, vbCr) & _
"The address is " & AddList(FieldName, TemplateNumber)
End Sub
It is ready to run. Test it.
To use this whole setup you can now proceed to define cells from any of your templates after you know the worksheet's name and its template number. Ws.Range(AddList(NccCity, Ncc2)).Value will return the name of the city from template 2 according to the address for that field stored in the cache.