Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Francisca Perez   on Oct 21 In MS Office Category.

  
Question Answered By: Hiroshi Yoshida   on Oct 21

You need just one extra line for the second column (I'm assuing it is
H10 below). Try this:

--------------------------
Sub MakeSummrySheet()

Dim strMain As String
Dim strName As String

Sheets.Add Before:=Sheets(1)
ActiveSheet.Name = "Summary sheet"

Range("a1").Select

For Each c In Sheets
If c.Name <> "Summary sheet" Then
strName = c.Name
Selection.Value = c.Name
strMain = "='" & c.Name & "'!G10"
Selection.Offset(0, 1).Formula = strMain
strMain = "='" & c.Name & "'!H10"
Selection.Offset(0, 2).Formula = strMain
Selection.Offset(1, 0).Select
End If
Next c

---------------------------

Creating the totals  can be done in code, but when it's only a couple of
clicks using the autosum button it hardly seems worth it!

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 


Tagged: