LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Loop - for each sheet not working?

I want a value to be written to same cell of all the sheets. I have
following macro written.
===========
Sub All_Sheets_Loop()
Dim i As Integer
Dim sh As Worksheet

For Each sh In ThisWorkbook.Worksheets
ActiveSheet.Range("A1").Value = 10
Next
End Sub
===========
Above macro writes only in the active sheet and other sheets are not
written by the value.
If I add a line activate.sheet it gives error.
Any thoughts pl?
Shetty
 
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
Loop all Sheets not working. Pank New Users to Excel 12 February 27th 07 11:55 AM
On Error GoTo Label in a loop only working once. Ken Johnson Charts and Charting in Excel 4 July 5th 06 09:39 PM
Another loop & sheet question steve Excel Programming 4 November 25th 03 02:12 PM
Using UsedRange as limits in a For Each loop but for cells on another sheet ? tur13o Excel Programming 2 October 23rd 03 01:18 PM
Excluding sheet in loop david Excel Programming 2 July 31st 03 03:18 AM


All times are GMT +1. The time now is 01:19 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"