ninjalearner
New Member
Hi All,.
I am a learner in VBA and i need help with the following VBA code
I have an open workbook that contains 20 named worksheets.I have a list of 42 departments listed on range("A2:A43") in my sheet1. The 20 worksheets are named after the department list on sheet1.I am Looking for a VBA code that will Go through the cell contents of the range in sheet1 then loop through the names of the 20 worksheets in the workbook, then identify every name in sheet1 that deosnt have a worksheet opened in its name, then go ahead and open the worksheet and name it appropriately. This will continue untill it has opened all required worksheets named after the departments in range A2:A43.
This code will conclude by looping through all the worksheets and if there is any worksheet not named after a value in range A2.A43 will delete that worksheet from the workbook.
I am a learner in VBA and i need help with the following VBA code
I have an open workbook that contains 20 named worksheets.I have a list of 42 departments listed on range("A2:A43") in my sheet1. The 20 worksheets are named after the department list on sheet1.I am Looking for a VBA code that will Go through the cell contents of the range in sheet1 then loop through the names of the 20 worksheets in the workbook, then identify every name in sheet1 that deosnt have a worksheet opened in its name, then go ahead and open the worksheet and name it appropriately. This will continue untill it has opened all required worksheets named after the departments in range A2:A43.
This code will conclude by looping through all the worksheets and if there is any worksheet not named after a value in range A2.A43 will delete that worksheet from the workbook.