dnickelson
Board Regular
- Joined
- Oct 30, 2003
- Messages
- 118
Hello All,
Probably a simple question, but nothing coming up in searching the board.
I created some code to create several worksheets from a list that was captured from one of the other worksheets, but the code is set to be used over when the list changes, and I need an easy way to get rid of the sheets created previously. What I'm going for is basically
For Each Worksheet In Workbook
if worksheet.name contains "pc-" then
Delete Worksheet
Next
but not sure how to implement the if worksheet.name contains "pc-", VBA catches the syntax mistake before I even bother trying to run the code, but I'm not sure how to word it.
I'm assuming the above is enough of an explanation, but I'll expand if requested.
Probably a simple question, but nothing coming up in searching the board.
I created some code to create several worksheets from a list that was captured from one of the other worksheets, but the code is set to be used over when the list changes, and I need an easy way to get rid of the sheets created previously. What I'm going for is basically
For Each Worksheet In Workbook
if worksheet.name contains "pc-" then
Delete Worksheet
Next
but not sure how to implement the if worksheet.name contains "pc-", VBA catches the syntax mistake before I even bother trying to run the code, but I'm not sure how to word it.
I'm assuming the above is enough of an explanation, but I'll expand if requested.