I currently have vba code that runs through all of the named ranges in the workbook and for every sheet within an array of all the sheets in the work book it will find a specific named range and copy that data to different data dump location.
What I would like, is for the user to be able to select which sheets out of all the sheets in the workbook they want the code to run on specifically, instead of it running based on a defined/static array of sheets
Here is the part of the code that I would like to change:
Thank you all in advanced for the assistance.
What I would like, is for the user to be able to select which sheets out of all the sheets in the workbook they want the code to run on specifically, instead of it running based on a defined/static array of sheets
Here is the part of the code that I would like to change:
Code:
Dim WshtNames As VariantDim WshtNameCrnt As Variant
Dim wb As Workbook
Set wb = ActiveWorkbook
Dim UpldNames As Variant
Dim UpldNameCrnt As Name
''''Determine applicable tabs.
WshtNames = list of tabs with yellow boxes for upload purposes
WshtNames = Array("NewShare", "1590_Migration Depts", "PrjSvc", "Talent Mgmt CoE", "COS Intra-COS Alloc", "ADP RM", "Benefits CoE", "TLMeTimeUsage", "BenefitsToCOS", "Division", "TLM_CoE", "TLM_Depreciation", "FulfAllocSHPS", "FulfAllocNonSHPSBen", "ProB_COS", "PSC_COS", "COS_SASS")
For Each WshtNameCrnt In WshtNames
With Worksheets(WshtNameCrnt)
Worksheets(WshtNameCrnt).Activate
For Each UpldNameCrnt In ActiveWorkbook.Names
If Left(UpldNameCrnt.Name, 6) = "Upload" Then
If UpldNameCrnt.RefersToRange.Parent.Name = ActiveSheet.Name Then
[THIS SECTION IS WHERE THE MAIN COPY/PASTE CODE GOES I LEFT IT OUT TO SAVE SPACE]
End If
End If
Next UpldNameCrnt
Thank you all in advanced for the assistance.