+ Reply to Thread
Results 1 to 4 of 4

VBA code to extract and reorganize data from table in Excel

  1. #1
    Forum Contributor
    Join Date
    08-05-2009
    Location
    Colorado Springs, CO
    MS-Off Ver
    Office 365
    Posts
    161

    VBA code to extract and reorganize data from table in Excel

    I use an application (not Excel), which creates output in an Excel file. The data is organized into named tables which are of variable length and number. At the end of the file there is a index of all of the named tables. All of the data in these tables is in columns A through Q. Most of the data of interest is in columns A through C. Column A will have the name of a Table, below which will be a list of verbose names for the data in column C. In column B will be a list of codes which relates to the verbose name in the originating application. In column C will be most of the data I'm interested in. What I want to do is copy the data below the table name header and the corresponding data in column C into another spreadsheet. This is easy enough to do once the addresses of the cells with the data are known. The table structure is no completely uniform, so that I need to be able to identify which table I'm working with, and then identify the range of cells immediately below the table heading, and then copy parts or all of this data to another workbook.

    Thanks for any suggestions (I am not a programmer, but I work with vba quite a bit).

    I know how to find the cell with a particular named table. I'm struggling with how to identify the area of cells below the table headings which comprises the the actual table data.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: VBA code to extract and reorganize data from table in Excel

    Are these actual, true Excel Tables or regular data ranges? Also attaching a sample workbook will help us help you a lot.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    08-05-2009
    Location
    Colorado Springs, CO
    MS-Off Ver
    Office 365
    Posts
    161

    Re: VBA code to extract and reorganize data from table in Excel

    Please Login or Register  to view this content.
    This is an example of one of the tables, which are in an actual Excel file. The approximate number of tables varies from 25 to 100. The tables have different numbers of rows and headers. I would want to be able to transfer the data in the first and third columns to an empty workbook. I can open the workbook and find a given table using vba, but I'm stuck on how to capture the exact data I want and put it in another workbook.
    Obviously, I could just create links to get the data, but the file isn't going to be exactly the same each time, so I need to be able to query the file and extract the data I want and reorganize it into usable report formats.
    Last edited by Atom; 06-26-2016 at 09:38 AM.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: VBA code to extract and reorganize data from table in Excel

    The important question is: when you say the files aren't exactly going to be the same every time, do you mean that they only have a variable number of rows or can the number of columns also be variable?

    It would help a lot of you could zip up a couple of sample files and attach them.

+ 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. VB Code to reorganize data..
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-19-2016, 11:09 PM
  2. VB Code to reorganize data in a sheet
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2016, 08:27 PM
  3. [SOLVED] VB Code to reorganize ClockINOut
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-09-2016, 06:29 PM
  4. [SOLVED] VB Code to reorganize data
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 03-29-2016, 04:24 PM
  5. [SOLVED] Formula to Reorganize the table
    By hbender in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-09-2015, 12:54 PM
  6. Replies: 3
    Last Post: 12-18-2014, 10:27 AM
  7. Extract data (not in table) from Word to Excel
    By hellokitty77 in forum Excel General
    Replies: 1
    Last Post: 01-14-2006, 09:55 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