Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Loop thru woorksheets

I need to loop thru each worksheet in a workbook and clear the contents
except for the header row. Can anyone suggest a good way to do this in VBA?


Thank You


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Loop thru woorksheets

option explicit
sub testme()
dim wks as worksheet
for each wks in activeworkbook.worksheets
with wks
.range("2:" & .rows.count).clearcontents
end with
next wks
end sub

Striker wrote:

I need to loop thru each worksheet in a workbook and clear the contents
except for the header row. Can anyone suggest a good way to do this in VBA?

Thank You


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and Paste to multiple woorksheets at one time ManhattanRebel Excel Discussion (Misc queries) 0 February 12th 09 07:16 PM
2 woorksheets 1 workbook, help with lookup David D Excel Worksheet Functions 3 June 26th 07 01:48 PM
Consolidate Woorksheets DTTODGG Excel Worksheet Functions 0 November 7th 05 03:35 PM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Sharing woorksheets clemrogan Excel Worksheet Functions 0 April 25th 05 04:35 PM


All times are GMT +1. The time now is 03:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"