+ Reply to Thread
Results 1 to 4 of 4

Macro Command Button: Combine Save As CSV and Delete Unsed Rows Macros

Hybrid View

  1. #1
    Registered User
    Join Date
    03-08-2013
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Macro Command Button: Combine Save As CSV and Delete Unsed Rows Macros

    I am new to macros and command buttons, so I have no idea where to even start. I have a spreadsheet that, once saved as a CSV, is used to import data.

    I need to create a command button (e.g. "Save As CSV"), that will save the file as a csv and also removed any unused rows based certain cells being blank. I would like the rows to remain in my xlsm sheet (to be used again in the future by the user) but the CSV to be clean and only show the relivant data.

    I have attached my spreadsheet, in the example, rows 2-10 have good data (row 1 = header)... in my CSV file only rows 1-10 should populate.

    Thanks
    Kara

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Macro Command Button: Combine Save As CSV and Delete Unsed Rows Macros

    If a xlsx or xlsm file is saved in the csv format only one tab is saved (the current or selected one). The csv file will only contain those rows with values, while the original file will remain the same. Of course, to look at the original file, you will have to open it again.

  3. #3
    Registered User
    Join Date
    03-08-2013
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro Command Button: Combine Save As CSV and Delete Unsed Rows Macros

    In order for the spreadsheet to function correctly, the formulas are copied through row 1091, so the blank rows are not really empty as they have #N/A due to the formula... I have those cells conditional formatted to be white if the cell has an error, so the users are confused.

    For example, the user populates 91 rows with data, I want them to be able to click a single button that will create a CSV file AND delete the remaining 1000 rows. Otherwise the import with have errors and not be excepted.

    Thanks

  4. #4
    Registered User
    Join Date
    04-15-2013
    Location
    Wisconsin, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro Command Button: Combine Save As CSV and Delete Unsed Rows Macros

    I am interested in this solution also. Very similar problem and I too am new to macros in Excel. Sally, you or anyone with sample code that works for this?
    Last edited by geogherkins; 04-15-2013 at 10:41 AM. Reason: typo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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