+ Reply to Thread
Results 1 to 6 of 6

Retaining date format when pasting to Notepad (from Excel)

  1. #1
    Registered User
    Join Date
    01-21-2015
    Location
    Chicago
    MS-Off Ver
    8
    Posts
    4

    Retaining date format when pasting to Notepad (from Excel)

    Hello,

    The formatting of the dates in my Excel data are lost when pasted to Notepad. The Excel data date format is YYYYMMDD but pasted into Notepad in the MM/DD/YYYY. I know my code only copies/pastes values, not formats. Can someone help?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Retaining date format when pasting to Notepad (from Excel)

    Here you go, the chunk of relevant code. Basically I check to see if it's a date. If true, format it like I want it (YYYYMMDD), then cast it as a String. Since it is just a string at that point, the formatting shouldn't change in notepad.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-21-2015
    Location
    Chicago
    MS-Off Ver
    8
    Posts
    4

    Re: Retaining date format when pasting to Notepad (from Excel)

    Yay!!! It worked!!! Thank you soooo much! I almost gave up on this...you are a lifesaver

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Retaining date format when pasting to Notepad (from Excel)

    Great! Reputation is appreciated (the star a the bottom left of my posts), and don't forget to mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    01-21-2015
    Location
    Chicago
    MS-Off Ver
    8
    Posts
    4

    Re: Retaining date format when pasting to Notepad (from Excel)

    Done

    How do you mark this as solved? Sorry, I'm new lol.

  6. #6
    Registered User
    Join Date
    01-21-2015
    Location
    Chicago
    MS-Off Ver
    8
    Posts
    4

    Re: Retaining date format when pasting to Notepad (from Excel)

    Quote Originally Posted by blondeambition View Post
    Done

    How do you mark this as solved? Sorry, I'm new lol.
    I figured it out, thanks again walruseggman!

+ 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. Copying UK Dates from google spreadsheets and pasting into excel, retaining UK Format
    By notreallyIT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2013, 11:55 AM
  2. Pasting Excel data to Notepad
    By butcher11 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-09-2013, 04:28 PM
  3. Pasting content from Excel to Notepad
    By kandanuru in forum Excel General
    Replies: 1
    Last Post: 10-31-2012, 02:35 AM
  4. pasting text from notepad not appearing in excel
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-05-2012, 04:17 PM
  5. [SOLVED] Retaining Excel colors when pasting into Word or PowerPoint
    By sfflesley in forum Excel General
    Replies: 0
    Last Post: 04-25-2006, 11:15 AM

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