Hello there,
I am trying to convert the following code into a loop. The relationship between "Cascades_xx" and "Master_xx" changes depending on the total number of named ranges, and is contained in a separate table. Currently I enter the values manually for anywhere up to 200 named ranges. Below is a short version of the code I have:
Worksheets("Cascades").Range("Cascades_1").Copy _
Destination:=Worksheets("Master").Range("Master_3")
Worksheets("Cascades").Range("Cascades_2").Copy _
Destination:=Worksheets("Master").Range("Master_2")
Worksheets("Cascades").Range("Cascades_3").Copy _
Destination:=Worksheets("Master").Range("Master_1")
Worksheets("Cascades").Range("Cascades_4").Copy _
Destination:=Worksheets("Master").Range("Master_5")
Worksheets("Cascades").Range("Cascades_5").Copy _
Destination:=Worksheets("Master").Range("Master_4")
So what I'm after is a way to look up the corresponding "Master_xx" named range for each "Cascade_xx" named range, and then copy the "Cascade_xx" named range to that position.
Much appreciated.
I am trying to convert the following code into a loop. The relationship between "Cascades_xx" and "Master_xx" changes depending on the total number of named ranges, and is contained in a separate table. Currently I enter the values manually for anywhere up to 200 named ranges. Below is a short version of the code I have:
Worksheets("Cascades").Range("Cascades_1").Copy _
Destination:=Worksheets("Master").Range("Master_3")
Worksheets("Cascades").Range("Cascades_2").Copy _
Destination:=Worksheets("Master").Range("Master_2")
Worksheets("Cascades").Range("Cascades_3").Copy _
Destination:=Worksheets("Master").Range("Master_1")
Worksheets("Cascades").Range("Cascades_4").Copy _
Destination:=Worksheets("Master").Range("Master_5")
Worksheets("Cascades").Range("Cascades_5").Copy _
Destination:=Worksheets("Master").Range("Master_4")
So what I'm after is a way to look up the corresponding "Master_xx" named range for each "Cascade_xx" named range, and then copy the "Cascade_xx" named range to that position.
Much appreciated.