Either make sure you have a worksheet named Sheet1 when you start the macro.
Or change this line:
Const SumSheetName = "Sheet1"
to show the name of the sheet that acts as a summary sheet.
If that's not the line that causes the error, then you'll have to share more
information.
farid2001 wrote:
>
> Thanks guys, but I get error message "Subindex out of interval"
> What could be wrong?
>
> Regards
> farid2001
>
> "mikeaj72" wrote:
>
> >
> > Code:
> > --------------------
> > Sub testing()
> > Const SumSheetName = "Sheet1"
> > Dim sumWS As Worksheet
> > Dim ws As Worksheet
> > Dim i As Long
> > i = 1
> > Set sumWS = Worksheets(SumSheetName)
> > For Each ws In Worksheets
> > If ws.Name <> sumWS.Name Then
> > sumWS.Range("A" & i) = ws.Range("F2")
> > sumWS.Range("B" & i) = ws.Range("J2")
> > i = i + 1
> > End If
> > Next ws
> > End Sub
> > --------------------
> >
> >
> > --
> > mikeaj72
> > ------------------------------------------------------------------------
> > mikeaj72's Profile: http://www.thecodecage.com/forumz/member.php?userid=46
> > View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=44996
> >
> >
--
Dave Peterson