Immatoity
03-28-2006, 05:20 AM
I have searched and tried some code but I must be doing something stupid...
I want part of my macro to delete a sheet (only if it exists).. if it does exist delete it and carry on with rest of code, if it doesn't exist, simply carry on with the rest of the code.
The workbook has only one module in it... the sheet name it needs to check for and delete is "Adjusted Data"... the reason I need to delete it if its there is that the code afterwards copies another sheet's data and renames that to "Adjusted Data"..it will fail if the sheet name already exists.
Also, any code you kindly provide...let me know if I need a seperate module or whatever as thats where I get stuck... I would prefer it if it is in one..
NB the sub that copies and renames sheet is called "BlockedStockTidy"
I want part of my macro to delete a sheet (only if it exists).. if it does exist delete it and carry on with rest of code, if it doesn't exist, simply carry on with the rest of the code.
The workbook has only one module in it... the sheet name it needs to check for and delete is "Adjusted Data"... the reason I need to delete it if its there is that the code afterwards copies another sheet's data and renames that to "Adjusted Data"..it will fail if the sheet name already exists.
Also, any code you kindly provide...let me know if I need a seperate module or whatever as thats where I get stuck... I would prefer it if it is in one..
NB the sub that copies and renames sheet is called "BlockedStockTidy"