Hi all,
I want to refer to a range within my code, but that range should change depending on what is selected in my combo box. Basically I would have hundred of ranges such as e.g.
MTR_CHN_TTL_RTL
MTR_CHN_DTC_RTL
MTR_CHN_DTC_CST
MTR_KOR_TTL_RTL
MTR_JPN_DTC_RTL
MTR_JPN_DTC_RTL
where the first part of the range name "MTR" always stays the same and the second part e.g. "JPN" changes depending on the region I select in my combo box, so it should take it from the defined range "Selected_Region", the third part e.g. "TTL" changes depending on the range "Selected_WHSL" and the last part e.g. "RTL" changes depending on the metric selected Range("Selected_Metric). How can I write that in my code to always add the correct range depending on what is selected?
![]()
ActiveWorkbook.Names.Add "R_Analytics", Worksheets("Analytics").Range("MTR_&Range("Selected_Region")&_&Range("Selected_WHSL")&_&Range("Selected_Metric")")
Bookmarks