+ Reply to Thread
Results 1 to 4 of 4

Trying to summarise data on different sheets

  1. #1
    Registered User
    Join Date
    10-19-2021
    Location
    London
    MS-Off Ver
    2013
    Posts
    2

    Trying to summarise data on different sheets

    Hi everyone,

    I'm trying to glean some data from different sheets in the workbook, then output the summary onto a sheet named "Summary". So far, I have written the following VBA code but it doesn't run! I'm not sure what I'm doing wrong so I thought I'd ask on here if anyone who is more knowledgable than me could point me in the right direction please!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Trying to summarise data on different sheets

    Activating and also relying on the active sheet is not really good practise. Try like this instead:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi, try this !


    Quote Originally Posted by tinyTrexTony View Post
    could point me in the right direction
    Your VBA procedure revamped :

    PHP Code: 
    Sub Demo1()
      Const 
    "Summary"
        
    Dim R&, N&
            
    1
            Application
    .ScreenUpdating False
        
    For 1 To Worksheets.Count
            With Worksheets
    (N).Rows("4:258").Columns
                
    If .Parent.Name <> S Then
                    R 
    1
                    Sheets
    (S).Rows(R).Range("A1:F1").Value2 = Array(.Parent.Name, .Cells(5)(0).ValueApplication.Sum(.Item(5)), _
                                              Application
    .Sum(.Item(11)), Application.Sum(.Item(17)), Application.Sum(.Item(23)))
                
    End If
            
    End With
        Next
            Application
    .ScreenUpdating True
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  4. #4
    Registered User
    Join Date
    10-19-2021
    Location
    London
    MS-Off Ver
    2013
    Posts
    2

    Re: Hi, try this !

    This is really elegant, thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Summarise data in one sheet from multiple sheets
    By rajeev.raj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2018, 03:18 PM
  2. Summarise multiple sheets
    By dreams1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-11-2013, 04:53 PM
  3. [SOLVED] How to summarise 9 sheets into sheet 1
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-14-2012, 04:44 AM
  4. Summarise multiple sheets with checkboxes
    By Kazstankgardner in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2012, 08:19 PM
  5. Summarise Multiple Sheets
    By thatitalian in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-10-2012, 06:23 AM
  6. Summarise data from multiple sheets based on dates
    By tanktata in forum Excel General
    Replies: 4
    Last Post: 02-21-2012, 02:54 PM
  7. Replies: 2
    Last Post: 09-22-2010, 10:48 AM

Tags for this Thread

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