View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default How to create Loop

Hi,

Put this in a module and it wil scroll through each sheet and clear the
contents of A1. You could of course do something far more adventurous than
that

Sub scrollem()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Select
Range("A1").ClearContents
Next ws
End Sub


Mike

"Sandeep P" wrote:

I have recorded a macro to delete some row and then move to next sheet and
perform the same action on the next sheet also until all the sheets are done.

but it works fine for 1st sheet and does not work for sheets further.

How can we run the same recorded macro in loop so that it performs the same
action on all sheets

Could you please help