+ Reply to Thread
Results 1 to 6 of 6

Export Table Headers and Totals only as CSV

  1. #1
    Registered User
    Join Date
    04-10-2020
    Location
    Lebanon
    MS-Off Ver
    2003
    Posts
    11

    Lightbulb Export Table Headers and Totals only as CSV

    Hi All. I am very new to VBA and programming so please make it simple for me.

    I want to export a table Headers and Totals row only to CSV.

    How can I do this thru VBA?

    Thanks,

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Export Table Headers and Totals only as CSV

    Is the header row the first row?

    How do you identify the total row(s)? Is it the last row on the sheet, or are there several total rows?

    Post a sample workbook.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    04-10-2020
    Location
    Lebanon
    MS-Off Ver
    2003
    Posts
    11

    Re: Export Table Headers and Totals only as CSV

    Thank you,

    Yes. The table is on separate sheet. The Headers is the first row
    and the subtotals are on the last row.

    However, There are many workbooks with tables, all having the same sheet name "S" and the same table name "S"
    but they vary in row count
    (some tables 500 rows and others are 1800 rows so a fixed range is not an option)
    I am thinking to export to CVS the headers by
    Please Login or Register  to view this content.
    and totals rows by
    Please Login or Register  to view this content.
    But cant figure how. I will try to post a sample file later on.

    Mean time, any ideas are appreciated.

    Thanks.
    Last edited by alansidman; 11-22-2020 at 09:36 AM.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Export Table Headers and Totals only as CSV

    Well, thinking out loud, I’d probably move/copy the whole sheet and then convert the total row to values. Then you can delete the DataBody rows and save just the header and total rows to your csv file.

    Untried and untested at the moment, but that's the theory.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,214

    Re: Export Table Headers and Totals only as CSV

    This will give you an idea...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  6. #6
    Registered User
    Join Date
    04-10-2020
    Location
    Lebanon
    MS-Off Ver
    2003
    Posts
    11

    Re: Export Table Headers and Totals only as CSV

    Thanks. I am trying a solution will get back later.
    Last edited by ZaherHabhab; 11-26-2020 at 02:54 AM.

+ 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. [SOLVED] Copy data from a pivot table without headers and grand totals
    By magge in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2020, 06:58 AM
  2. [SOLVED] Export whole table with headers from Excel to Access
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-06-2016, 03:59 AM
  3. autofilter method of range class failed -header has tables headers and non table headers
    By naveen.acheanz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-16-2016, 08:21 AM
  4. Export excel to txt ignoring headers
    By Ryonite in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2015, 10:16 AM
  5. export email headers to excel from outlook
    By Rainnstar in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2012, 05:42 PM
  6. Export Excel into csv: Why headers and empty cells!?!
    By FlipFlops in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-24-2011, 12:56 PM
  7. Change Pivot table text for totals & col headers?
    By Sue in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-15-2006, 12:20 PM

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