Friends,
I have this code that someone helped me with that works well for retreiving the worksheet names from an opened workbook after inputing the name of a workbook in an input box. My problem with it, is that once you put the name of that workbook (from which you want to retreive worksheet names) in the input box and click enter, the names are listed starting in row two and then each consecutive time this code is entered, the names simply appear starting at the end of the worksheet names list. The revision I need to the code is for the worksheet names that appear, I need those to be over-ridden each time this code is executed.
Example:
1 - You open the input box in the below code by executing the macro.
2 - You type in the name of an open workbook you have. Let's call it "Workbook 1."
3 - Once you type "Workbook 1" and hit enter, all the names of all worksheets in Workbook 1 are listed on your current worksheet.
4 - If this code is executed again, then I would like for those names that have been listed as a result of the code being run the first time, to be deleted and replaced with the worksheet names.
Currently in this last step (step 4 above), when the code is executed a second time, the worksheet names are automatically listed below the previously executed code.
Here is the code as it currently stands:
Please Login or Register to view this content.
Bookmarks