+ Reply to Thread
Results 1 to 2 of 2

Autosum range

Hybrid View

  1. #1
    Registered User
    Join Date
    08-10-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2013
    Posts
    17

    Autosum range

    Hello,

    I have a script that makes multiple copies of a template and pastes subtotals to a summary sheet (NSN Summary) from those new worksheets. I need a way to AUTOSUM those subtotals on the NSN Summary sheet. I am thinking it would be a separate macro using ActiveCell.Offset but don't know how. Thanks.


    Sub CopyTemplates()
        Dim LR          As Long
        Dim i           As Long
    
        Application.ScreenUpdating = False
        Worksheets("Template").Visible = True
        
        Call AutoNum
        
        With Worksheets("Fill This Out First")
            LR = .Range("A" & 5).End(xlDown).Row
    
            For i = 5 To LR
                If Not Evaluate("isref(" & .Range("A" & i).Value & "!A1)") Then
                    Worksheets("Template").Copy After:=Sheets(Sheets.Count)
                    ActiveSheet.Name = .Range("A" & i).Value
    
                    Range("D1:D2").Value = Range("D1:D2").Value
                    Range("D5").Value = .Cells(i, "B").Value
                    Range("H3").Value = "CLIN " & Format(.Cells(i, "C").Value, "0000")
    
                    Worksheets("NSN Summary").Cells(i + 24, "B").Value = Range("H3").Value
                    Worksheets("NSN Summary").Cells(i + 24, "C").Formula = "=" & Range("H40").Address(External:=True)
                    'This is where I need the AUTOSUM for each subtotal ("H40")   
            End If
            Next i
        End With
    
        Worksheets("Template").Visible = xlSheetHidden
        Application.ScreenUpdating = True
    End Sub

  2. #2
    Registered User
    Join Date
    08-10-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: Autosum range

    It this possible?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1