ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Clear Contents (https://www.excelbanter.com/excel-discussion-misc-queries/218801-clear-contents.html)

Secret Squirrel

Clear Contents
 
I have 12 worksheets in my file and I need to clear the contents of only 4 of
them but the ranges I need cleared are different on all 4 of these
worksheets. How can I set up vba code to clear the contents with my specified
ranges and worksheet names?

Don Guillett

Clear Contents
 
Pretty easy

sub clearem
sheets("aa").range("a2:x33").clearcontents
sheets("bb").range("c22:x333").clearcontents
end sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Secret Squirrel" wrote in
message ...
I have 12 worksheets in my file and I need to clear the contents of only 4
of
them but the ranges I need cleared are different on all 4 of these
worksheets. How can I set up vba code to clear the contents with my
specified
ranges and worksheet names?




All times are GMT +1. The time now is 06:02 AM.

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