J
Jeff Klein
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
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