+ Reply to Thread
Results 1 to 7 of 7

Macro- Format to correct data using VBA

  1. #1
    Registered User
    Join Date
    03-09-2016
    Location
    states
    MS-Off Ver
    2003
    Posts
    52

    Macro- Format to correct data using VBA

    Hello

    I have set up the following macro that when you click on convert to csv it converts the fields. The issue i have is I want to fix the columns date to format as MM/DD/YY when I click on the button 'convert to csv'.


    how would i do this?
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro- Format to correct data using VBA

    Just add

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    immediately before the .SaveAs instruction
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-09-2016
    Location
    states
    MS-Off Ver
    2003
    Posts
    52

    Re: Macro- Format to correct data using VBA

    Where would you add that code?

  4. #4
    Registered User
    Join Date
    03-09-2016
    Location
    states
    MS-Off Ver
    2003
    Posts
    52

    Re: Macro- Format to correct data using VBA

    Perfect thank you

  5. #5
    Registered User
    Join Date
    03-09-2016
    Location
    states
    MS-Off Ver
    2003
    Posts
    52

    Re: Macro- Format to correct data using VBA

    just noticed it does not work. it appears to not save anything else in the spreadsheet when i press the convert to csv

  6. #6
    Registered User
    Join Date
    03-09-2016
    Location
    states
    MS-Off Ver
    2003
    Posts
    52

    Re: Macro- Format to correct data using VBA

    My mistake all working now

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro- Format to correct data using VBA

    Your code does not include anything which populates the myCSVFileName variable.

+ 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] Data copied to correct format
    By celinedion in forum Excel General
    Replies: 5
    Last Post: 10-15-2017, 10:55 AM
  2. Macro to Automatically Format Cell to Correct Height
    By Cardan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2015, 05:25 PM
  3. [SOLVED] Check cells are correct format and contain correct data
    By rikosborne in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2014, 02:53 PM
  4. Macro to copy email to excel not in correct format
    By josh640557 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-16-2013, 11:59 AM
  5. Saving Excel Files to Correct Format with Macro
    By Smurlos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2010, 06:49 PM
  6. [SOLVED] Import data not in correct format
    By jlt in forum Excel General
    Replies: 0
    Last Post: 08-22-2005, 03:05 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