Working with multiple sheets

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Hi
I have a multiple sheet workbook that I want to delete the same cells in
each sheet. How do I set up a macro for someone else to do that if they are
constantly adding new duplicate sheets. I need a macro that will
automatically select the 2nd thru the last sheet so that the same cells on
all the those sheets can be deleted with one macro. Thanks! Jim
 
Jim,

By delete, do you mean remove their values? Assuming so,

Sub DeleteCells(Rng )
Dim i As Long

For i = 2 To Worksheets.Count
Worksheets(i).Range(Rng.Address).ClearContents'change ClearContents
to Clear to clear formats etc. as well
Next i
End Sub


run it like so

DeleteCells Range("A1:H100")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top