+ Reply to Thread
Results 1 to 12 of 12

Script that will combine data from different sheets

  1. #1
    Registered User
    Join Date
    03-25-2015
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2013
    Posts
    43

    Script that will combine data from different sheets

    Hello everyone,

    I have a document with multiple Worksheets (in the example i attached there are only 3), each Worksheet has the same type of data in the same format.

    I would like a script that can do the following in a different Worksheet:

    - Copy some of the data from each sheet into a new one
    - Separate the data from each sheet by one row and have that particular row named as the name of the worksheet of which the data will be next (if it is HC then the row that separates the RH issues from HC issue be named HC)

    I have attached an example of what i am talking about.

    New Microsoft Excel Worksheet.xlsx

    Thanks you in advance for your help,
    -Alex

  2. #2
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: Script that will combine data from different sheets

    Try this

    Please Login or Register  to view this content.
    !If all your troubles are solved, then so is the thread. Show this by marking it so using thread tools at the top of the page.
    If I helped do this, then please show your appreciation by awarding rep points.
    <------ Button for that is over there

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Script that will combine data from different sheets

    Try this code
    Please Login or Register  to view this content.
    Last edited by YasserKhalil; 07-28-2015 at 05:44 PM.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Script that will combine data from different sheets

    Here's another code
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-25-2015
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2013
    Posts
    43

    Re: Script that will combine data from different sheets

    Ok guys so ... the script that you gave me worked on that example excel file but when i tried to add it to my document i noticed something:

    - The script needs to identify the number of issues on each sheet, This can depend on the data i supply to that worksheet (let`s say that on the H worksheet i have 5 , on the RH i have 10 and on the HC i have 22)
    - If WS.Name <> "Example" Then this statement will not work as i have multiple worksheets in the original document. so i need to address this formula to only 5 specific worksheets

    Can you help me out here also?

    Sorry for any inconvenience. I really appreciate all of you help with this

    Thanks,
    -Alex

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Script that will combine data from different sheets

    Try this littlw modification
    Please Login or Register  to view this content.
    at this red part you can add more sheets you need to deal with
    If there is any problem you have to attach your original workbook

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Script that will combine data from different sheets

    Try
    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Script that will combine data from different sheets

    Mr. Jindon
    Great code but as for the expected output the OP needs specific columns not all columns

  9. #9
    Registered User
    Join Date
    03-25-2015
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2013
    Posts
    43

    Re: Script that will combine data from different sheets

    Hello YasserKhali,

    I am sorry but i was off on the formating of the pages that i want the data pulled from.

    The pages contain data from web pages. Below you can find an exact replica of the worksheets formating of the pages. Maybe this is why the script you created did not work as expected.

    Sorry again about this.

    model.xlsx

    Thank you again for your help.

    Cheers,
    -Alex

  10. #10
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Script that will combine data from different sheets

    Hi Alex
    May be because of row 6 is empty in your sheets
    Here's the model example modification. Hope it will solve your problem
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-25-2015
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2013
    Posts
    43

    Re: Script that will combine data from different sheets

    YasserKhalil you have my thanks. It worked like a charm

    You sir are a life saver.

    Thanks a million

  12. #12
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Script that will combine data from different sheets

    You're welcome.Glad I can help.
    Thanks for the rep points and for the feedback

+ 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. Script to update data in other sheets with data from current sheet
    By SeagullWardy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-19-2014, 12:00 PM
  2. To Combine Data from different sheets
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2013, 05:55 AM
  3. Combine data from two sheets
    By musa116 in forum Excel General
    Replies: 4
    Last Post: 11-29-2011, 11:42 AM
  4. how to combine 2 different sheets of data?
    By Christeen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2011, 02:39 AM
  5. Combine data from two sheets
    By mathew5548 in forum Excel General
    Replies: 1
    Last Post: 04-21-2010, 09:17 AM
  6. Combine 3 sheets of data
    By treva26 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2007, 03:11 AM
  7. [SOLVED] Combine data from two sheets in two one
    By Holger Lehniger in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-11-2006, 01:25 PM

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