+ Reply to Thread
Results 1 to 7 of 7

Macro to Combine data from different Sheets and Sheet names to a "Summary Worksheet"

  1. #1
    Registered User
    Join Date
    09-10-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2010
    Posts
    4

    Macro to Combine data from different Sheets and Sheet names to a "Summary Worksheet"

    Hello,

    I'm trying to create a macro for one of my reports in the office.

    The macro should copy each sheet names and paste it to Column A of the Summary Sheet, while the data on each sheet should be copied and pasted to column B of the Summary sheet, but should not include any data from the tab "Rejected Ballots".

    After lots of research (since I'm literally a newbie in excel VBA) I was able to combine the below command:

    Sub Audit()

    Dim A As Integer
    Dim S As Worksheet

    'Delete the summary sheet if it exists.
    Sheets(1).Select
    Worksheets.Add
    Sheets(1).Name = "Summary"

    If Range("B1").Value = ("") Then
    Columns(1).Insert
    For i = 1 To Sheets.Count
    Cells(i, 1) = Sheets(i).Name
    Next i
    End If

    Sheets(2).Activate
    Range("A1").EntireColumn.Select
    Selection.Copy Destination:=Sheets(1).Range("B1")

    End Sub

    But it looks like, this is wrong (sadly).

    Can someone please help me?

    Please note that the report sometimes have 30 sheets and the data for each sheet will always be in column A and sometimes it will reach the cell "A300". I have attached a sample of my report.

    Thanks in advance,

    Jeremie
    Attached Files Attached Files
    Last edited by Jemz0410; 09-11-2015 at 06:20 AM. Reason: Solved!!!

  2. #2
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Macro to Combine data from different Sheets and Sheet names to a "Summary Worksheet"

    Hi There,

    is the Tab "Result after running the Macro" what you expect as a Result?
    If you dont mind the Question what is the Report about?
    Do you need to work with the Numbers in some way?

    Greets
    Loki

  3. #3
    Registered User
    Join Date
    09-10-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro to Combine data from different Sheets and Sheet names to a "Summary Worksheet"

    Hello Loki,

    Thanks for the response.
    Yes, the tab "Result after running the Macro" is the expected result. The data on the sheets contains numbers but no formula needs to be executed, I just have to copy those data to a "Summary Sheet".

    This report is a Monthly Audit of what we've processed for a month. The numerical values are called "Ballot IDs" (those in the example are not actual ballot IDs).

    Thank you,

    Jemz0410

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Macro to Combine data from different Sheets and Sheet names to a "Summary Worksheet"

    Please Login or Register  to view this content.

    Kind regards
    Leo
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-10-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro to Combine data from different Sheets and Sheet names to a "Summary Worksheet"

    Wow!!! Thanks Leo...It works Great!!

    Add Rep!!

  6. #6
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Macro to Combine data from different Sheets and Sheet names to a "Summary Worksheet"

    Hi Jemz,

    The Answer leo provided should work perfect.
    My Question would be if it would not make more sense to show the Total day Directly?
    Or do you need all the values seperated??

  7. #7
    Registered User
    Join Date
    09-10-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro to Combine data from different Sheets and Sheet names to a "Summary Worksheet"

    Hello Lord Loki,

    Nope I only need to copy all of the data and sheet names to a single sheet (Summary Sheet)

    Thanks,

    Jemz0410

+ 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. Replies: 3
    Last Post: 06-05-2015, 01:55 PM
  2. Export the sheets to PDF Format which has the word "Summary" in Sheet Names
    By Kandavalli.Kiran in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2015, 09:14 AM
  3. Replies: 3
    Last Post: 05-31-2013, 05:16 AM
  4. [SOLVED] Need Macro to compile data from "Weekly" sheets and sum up into "Monthly" summary sheet
    By mo4391 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-21-2013, 07:25 PM
  5. Enter Data on "Main" or "Input" Sheet and Copy to One of Many Other Sheets
    By timothy_no7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2012, 07:29 PM
  6. Macro code for "summary" worksheet only
    By daisy2012 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2012, 03:10 AM
  7. Copy data from multiples sheets to specific cells in "summary"
    By sweetboy02125 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2010, 10:05 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