+ Reply to Thread
Results 1 to 3 of 3

How do you code in VB script to extract data from all worksheets in an Excel Spreadsheet t

  1. #1
    Registered User
    Join Date
    09-24-2013
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    1

    How do you code in VB script to extract data from all worksheets in an Excel Spreadsheet t

    How do you code in VB script to extract data from all worksheets in an Excel Spreadsheet to one worksheet?

    I have three spreadsheets in an excel file called book.xlsx.

    1st spreadsheet contains following data.

    account first_name last_name zip rate
    1 mike test 66550 G
    2 adam test2 75689 G

    2nd spreadsheet contains following data.

    account first_name last_name zip rate
    5 jill test4 55550 G


    3rd spreadsheet contains following data.

    account first_name last_name zip rate
    7 nancy test3 60555 G
    10 linda test5 77554 A
    11 marcie test6 77777 C

    Would like to combine all of these results into 1 worksheet. Would only like to have first_name,last_name and rate columns in a new worksheet.
    Ignore column headings and omit account and zip column. How would you script this in Visual Basic?
    NOTE: First row of data with column heading starts on row 10 for all worksheets. So, we want to grab any data starting from row 11.

    Desire results in a new Excel worksheet:

    mike test G
    adam test2 G
    jill test4 G
    nancy test3 G
    linda test5 A
    marcie test6 C

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: How do you code in VB script to extract data from all worksheets in an Excel Spreadshe

    Here is a good tutorial on how to set this up. You will of course have to tweak it a little bit for your situation. Once you hit a stumbling block, post back with your what you have and the issues you are encountering.

    http://en.kioskea.net/faq/24666-exce...other-workbook
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How do you code in VB script to extract data from all worksheets in an Excel Spreadshe

    'MANY SHEETS TO ONE SHEET
    Here's a macro for merging data from multiple sheets into a "consolidation" sheet where the source sheets are the same layout.There's a sample file there, too, to make it easy to try it out.



    I would simply use that to merge all the data, then delete the two columns you don't want.
    Last edited by JBeaucaire; 12-27-2019 at 04:25 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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. how to Extract specific data from excel spreadsheet?
    By roopa m j in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-17-2013, 12:03 AM
  2. [SOLVED] Macro Code to Extract Specific Data from Spreadsheet with Merged Cells
    By miroslav23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2013, 12:28 PM
  3. VBA script to extract data from server
    By crazydude80 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-04-2012, 12:13 AM
  4. Replies: 0
    Last Post: 02-14-2012, 12:31 PM
  5. Macro code to extract data from spreadsheet into 3 word documents
    By nurseydiamond in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2010, 08:13 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