+ Reply to Thread
Results 1 to 7 of 7

Save Range as CSV and update range format in CSV before saving.

  1. #1
    Registered User
    Join Date
    01-21-2018
    Location
    Northampton, England
    MS-Off Ver
    2010
    Posts
    61

    Save Range as CSV and update range format in CSV before saving.

    Hello all,

    I have the below code however i need to edit the CSV data before it saves as currently the copy and past section looses the formating.

    Please Login or Register  to view this content.

    This is the section that im looking to do in the CSV the following
    Please Login or Register  to view this content.
    Thanks for your help.

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Save Range as CSV and update range format in CSV before saving.

    A sample workbook would be much clear with what you want to achieve. see the yellow banner

    You are pasting as values with no formatting and losing formatting. Are you trying to repeat the formats from the original document? If so why not paste the formats as well?

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Save Range as CSV and update range format in CSV before saving.

    If the original data is formatted properly then just try remove xlPasteValues.

  4. #4
    Registered User
    Join Date
    01-21-2018
    Location
    Northampton, England
    MS-Off Ver
    2010
    Posts
    61

    Re: Save Range as CSV and update range format in CSV before saving.

    Thanks Jindon, The data in the origional document it correct but is prone to other users changing headings or format. What im attempting to do is merge the first and second set of code into one macro so the process would be,
    Copy and Past range from core document to new document > Edit Formating and headings > Save under the new file name.

    Thanks in advance.
    Last edited by AliGW; 09-24-2021 at 04:28 AM. Reason: PLEASE don't quote unnecessarily!

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Save Range as CSV and update range format in CSV before saving.

    If you want to combine 2 codes then should be look like(untested)
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-21-2018
    Location
    Northampton, England
    MS-Off Ver
    2010
    Posts
    61

    Re: Save Range as CSV and update range format in CSV before saving.

    Thanks jindon
    All seems to work however the date format still comes up as UK Date "dd/mm/yyyy" cont figure out why it doesnt conform to the format stated
    Last edited by AliGW; 09-24-2021 at 04:46 AM. Reason: PLEASE stop quoting unnecessarily!

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Save Range as CSV and update range format in CSV before saving.

    That means that column is Text date, not Serial date, I guess.

    Or just realized that "Date" Column is "E" in new workbook...
    Last edited by jindon; 09-24-2021 at 04:49 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] Save and restore (or transfer) a range's format properties
    By Warbe in forum Tips and Tutorials
    Replies: 0
    Last Post: 07-24-2019, 05:59 PM
  2. [SOLVED] Saving a range of excel cells as a script file (scr.) without "Save As" prompt screen
    By blake.dennis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-03-2016, 01:16 PM
  3. Replies: 0
    Last Post: 02-16-2013, 01:39 PM
  4. [SOLVED] Saving a specific cell range in a pdf format
    By jjin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-02-2013, 10:27 AM
  5. [SOLVED] Saving range of cells in a PDF format using a button on excel worksheet
    By jjin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-13-2013, 12:18 PM
  6. [SOLVED] Save selected range in a pdf format & email the file to a someone automatically?
    By jjin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-13-2013, 12:16 PM
  7. [SOLVED] Save a range to binary file (including its format)
    By Cool Sport in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2005, 10:06 AM

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