lynnsong986
Board Regular
- Joined
- May 24, 2014
- Messages
- 146
Hello,
I have a workbook with over 60 tabs, example of their names:
111100
111100A
111100Detail
111100B
213100
213100Detail
213100A
131460
131460Detail
312504
312504Detail
312504Ele
312504Wat
312504Gas
so they all start with a 6-digit code and they all have a code+Detail tab, but other than that, some can have more tabs and others don't. I have the list of the 6-digit on Sheet1 such as:
111100
213100
312504
what I need is for the codes to copy tabs starting with each of these values, i.e.
111100
111100A
111100Detail
111100B
will be copied to a new workbook
213100
213100Detail
213100A
will be copied to a new workbook
312504
312504Detail
312504Ele
312504Wat
312504Gas
will be copied to a new workbook
131460 will be copied at all because it is not on the list.
I don't know how to code this line: "if the tab name start with the cell value, then copy it", I'm not sure how to use * in this case. can someone please show me how to code this part?
thanks so much,
I have a workbook with over 60 tabs, example of their names:
111100
111100A
111100Detail
111100B
213100
213100Detail
213100A
131460
131460Detail
312504
312504Detail
312504Ele
312504Wat
312504Gas
so they all start with a 6-digit code and they all have a code+Detail tab, but other than that, some can have more tabs and others don't. I have the list of the 6-digit on Sheet1 such as:
111100
213100
312504
what I need is for the codes to copy tabs starting with each of these values, i.e.
111100
111100A
111100Detail
111100B
will be copied to a new workbook
213100
213100Detail
213100A
will be copied to a new workbook
312504
312504Detail
312504Ele
312504Wat
312504Gas
will be copied to a new workbook
131460 will be copied at all because it is not on the list.
I don't know how to code this line: "if the tab name start with the cell value, then copy it", I'm not sure how to use * in this case. can someone please show me how to code this part?
thanks so much,