ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Setting up and Configuration of Excel (https://www.excelbanter.com/setting-up-configuration-excel/)
-   -   Mutiple page delete macro's (https://www.excelbanter.com/setting-up-configuration-excel/38001-mutiple-page-delete-macros.html)

shrek

Mutiple page delete macro's
 
Ive got a work book with 6 sheets of data in it. Ive worked out how to delete each page indivudally. Im trying to find out how to delete the data in all 6 sheets at once whilst still keeping the template that all the data goes into. I use the assign macro using the tools on excel.


Can anyone help or point me in the right direction?

Im new to macro's so if a explination in idiot proof mode would be greatly appriciated.

FSt1

hi,
I thought this was going to be a snap at i began reading your thread. but
then you mentioned "whilst keeping the template"meaning now the delete must
be done surgically.
one way....
Sub DeleteAllData()
Sheets(Sheet1").select
Range("B5,D5,B7,D7,B9,D9,B11,D11").Clearcontents
Sheets(Sheet2").select
Range("B5,D5,B7,D7,B9,D9,B11,D11").ClearContents
'and so on for each sheet
end sub

the key would be to select all the cells that you want to clear while
leaving the other cells alone.

hope this gets you going in the right direction.
regards
FSt1
"shrek" wrote:


Ive got a work book with 6 sheets of data in it. Ive worked out how to
delete each page indivudally. Im trying to find out how to delete the
data in all 6 sheets at once whilst still keeping the template that all
the data goes into. I use the assign macro using the tools on excel.


Can anyone help or point me in the right direction?

Im new to macro's so if a explination in idiot proof mode would be
greatly appriciated.


--
shrek



All times are GMT +1. The time now is 11:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com