Results 1 to 14 of 14

How to save Excel file to csv with blank cells with formula with out getting commas.

Threaded View

  1. #12
    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
    48,155

    Re: How to save Excel file to csv with blank cells with formula with out getting commas.

    The date in column C is dependent on the formula that you use. I just drop that formula in and convert the result to a value. If you want to see what formula is going in there, comment out the ".Value = .Value" line of code. You can then evaluate the formula.

    That said, I just selected cell A2 and pressed F2 (to go into Edit mode) and then Enter (to recommit the value [Manchester]) and it generated the date value.

    The code doesn't actually disable Event handling because it doesn't make any changes on the sheet where the event is being trapped. I note that you have spelt "True" as "Ture" both in your post and in the code:

    'Closes the file
        .Close Ture

    I guess the reason that you are having problems changing the headings is that the Change Event handler is monitoring the entire columns A to D. Open the workbook without enabling macros, make the changes to your headings and then save the workbook. Open it again, this time enabling macros.

    Note: what is happening is that the code uses a variable, tr, for the Target Row. Because the csv doesn't have headers, the row is adjusted using the variable trm1 ... Target Row Minus 1. So, if you try to change row 1 on the Template sheet, the code is trying to write to row 0 which doesn't exist.


    Regards, TMS
    Last edited by TMS; 04-01-2014 at 07:58 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 9
    Last Post: 11-23-2016, 12:22 PM
  2. Blank cells but commas in Notepad
    By john_mc in forum Excel General
    Replies: 8
    Last Post: 07-02-2015, 04:42 PM
  3. [SOLVED] Remove blank cells from row, add commas between data in new cell
    By michellewayside in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 01-13-2014, 02:49 PM
  4. Output CSV file creates commas down blank rows
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2010, 05:54 AM
  5. Save in Excel with Commas
    By ftstrader in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-16-2009, 08:24 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