View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default Clearing Data ranges from Multiple Worksheets

I'm confused. Do you mean that you have 9 workBOOKs; each containing 10
workSHEETs?

If so, with only these workbooks open, run a macro such as the following:

Sub ClearDataRanges()
Dim wb As Workbook, ws As Worksheet
For Each wb In Workbooks
For Each ws In wb.Worksheets
ws.Range("A1:Z100").ClearContents
Next
Next
End Sub

--

Vasant



"Sam Fowler" wrote in message
...
Hi:

I am trying to clear the contents of certain cells in
several different worksheets at the same time. (Hopefully
with one macro. There are 9 worksheets, with each one
containing 10 pages. the pages are sized exactly the same
and may, or may not all contain data. I have been able to
get the pages to copy and paste to another sheet, but
would like to be able to select all of the pages and
clear data from the data ranges, without clearing my page
formatting, headers, etc. The data ranges are also
exactly the same cells in each worksheet.

Thanks,

Sam