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: 8
Default Processing code on wrong sheet

I Have a workbook with many sheets. I have code that calculates fields on
all of the sheets and writes the calculations on a "Summary" sheet. My
problem is: the calculations are showing up on the last sheet edited (not
the summary sheet) Any help is appreciated.

Below is the code:

Private Sub Workbook_Open()
Dim sh As Worksheet, sh1 As Worksheet
Dim i As Long

Set sh = Worksheets("Summary")
i = 0
For Each sh1 In Worksheets
If sh.Name < sh1.Name Then
i = i + 1
Cells(i, 1).Value = sh1.Range("c36").Value
Cells(i, 2).Value = sh1.Range("M34").Value
End If
Next
End Sub


 
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
What's wrong with my code ? christophe meresse Excel Worksheet Functions 3 August 2nd 05 05:09 PM
What's wrong w/my code? nrage21[_54_] Excel Programming 5 July 28th 04 03:50 PM
Can someone tell me what's wrong with this code please? malycom Excel Programming 4 June 3rd 04 03:26 PM
What is wrong with this code? Matt Excel Programming 0 January 22nd 04 08:11 PM
what's wrong with my code???? cornishbloke[_28_] Excel Programming 5 January 22nd 04 12:10 PM


All times are GMT +1. The time now is 10:32 AM.

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

About Us

"It's about Microsoft Excel"