Results 1 to 1 of 1

Copy summation only

Threaded View

  1. #1
    Registered User
    Join Date
    09-24-2008
    Location
    PA
    Posts
    13

    Copy summation only

    The below macro does copy and paste as it should, however cell H38 is a summation of other sheets and all I want is that final value in cell H38 to be copied. Is there a way to alter this portion of macro for summation copy and paste?

    'seventh macro
    'copy cells
    Sub copycell()
    Dim WS As Worksheet, wsum As Worksheet
    Dim wb As Workbook
    Dim vws As Variant 'Need to use a Variant for iterator
    Dim i As Integer, j As String
    
    i = 0
    Set wb = Workbooks("sheet1.xlsm")
    Set wsum = wb.Sheets("summary2")
    
    'Iterate through the sheets
    For Each vws In wb.Sheets
        If vws.Name <> "summary2" Then
            j = CStr(i + 2)
            vws.Range("b8").Copy wsum.Range("a" & j)
            vws.Range("b9").Copy wsum.Range("b" & j)
            vws.Range("b5").Copy wsum.Range("c" & j)
            vws.Range("H38").Copy wsum.Range("D" & j)
            i = i + 1
        End If
    Next vws
    
    End Sub
    Last edited by JBeaucaire; 08-20-2013 at 09:25 PM. Reason: Added CODE tags and corrected title, as per Forum Rules. Take a moment to read the Forum Rules in the menu bar above. Thank

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro not working in Excel 2010 but working in Excel 2003
    By mvel_sky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2013, 04:18 PM
  2. [SOLVED] macro not working
    By raffi123 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-05-2013, 10:07 AM
  3. Converting workbook with Macro to a template causes the Macro to stop working
    By Skeeta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2012, 02:00 PM
  4. Macro Stopped Working and Macro Not Listed
    By XLevel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2011, 04:43 AM
  5. Macro not working
    By HuskerBronco in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-27-2010, 07:06 AM

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