+ Reply to Thread
Results 1 to 6 of 6

How can I get my formula to 'paste special values' to preserve date formats?

Hybrid View

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    San Diego, CA USA
    MS-Off Ver
    Excel 2010
    Posts
    11

    How can I get my formula to 'paste special values' to preserve date formats?

    I have a worksheet that, when filled out, can convert the completed fields into a set of summarizing notes. To do this I am using the CONCATENATE formula to piece together several different fields into one string of text. Then a macro button that will copy the cell containing that formula and paste special values into another cell. Out come being one cell with copy-ready text that can be easily grabbed and pasted into another program.

    I'm having trouble with one field. The field is for a date of birth and the target cell is formatted as 3/14/81 (for March 13th 1981). However, when my formula grabs that cell it translates it to 29659 for some reason. I get a similar problem with phone numbers because the target cell is formatted to display properly, but what is entered and used by the formula is actually just 5555555555.

    Is there a way to get my formula to use the paste special values functionality so it grabs how a cell is displaying rather than what is in it, if that makes sense?

    If it helps, here's an example of my formula. The date is located in cell I17.



    Formula: copy to clipboard
    =CONCATENATE("FAXED AUTH PACKET TO PAYER", CHAR(10), CHAR(10), E17, " ", F17, CHAR(10), H17, " ", I17, CHAR(10), "PA ", E19, " ", F19, CHAR(10), "PA ", H19, " ", I19)




    I know I could accomplish this by running a macro to convert and then grabbing from the new location but to avoid additional button clicks by users I would have to do it in a VB script and I would like to avoid it if possible and keep this simple.

    Thanks in advance.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How can I get my formula to 'paste special values' to preserve date formats?

    whatever cell it is in instead of using say g1 use text(g1,"m/dd/yy")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How can I get my formula to 'paste special values' to preserve date formats?

    whatever cell it is in instead of using say e17 use text(e17,"m/dd/yy")
    CONCATENATE("FAXED AUTH PACKET TO PAYER", CHAR(10), CHAR(10), text(e17,"m/dd/yy"), " ", F17, CHAR(10), H17) like that
    and for phone number
    TEXT(h17,"[<=9999999]###-####;(###) ###-####")
    Last edited by martindwilson; 07-07-2013 at 04:12 PM.

  4. #4
    Registered User
    Join Date
    05-29-2012
    Location
    San Diego, CA USA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: How can I get my formula to 'paste special values' to preserve date formats?

    Thanks for your reply. For some reason that's not working. I've even tried taking the formatting off the target cell and tried formatting it as text and general. Even then, entering 3/14/81 into that cell, although it displays as such, shows 3/14/1981 in the formula bar. So it changes my input and no matter what I do to my formula, it reads that as 29659 in my destination cell. I also noticed that when I enter a date in the target cell it changes the formatting to date (which is a bit annoying)

    Any thoughts?

    Thanks again.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How can I get my formula to 'paste special values' to preserve date formats?

    well that's the way to do it. see attached
    fyi
    29659
    is the excel date code for 3/14/81 all dates are just numbers its just formatting that makes them appear as dates
    Attached Files Attached Files
    Last edited by martindwilson; 07-07-2013 at 08:04 PM.

  6. #6
    Registered User
    Join Date
    05-29-2012
    Location
    San Diego, CA USA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: How can I get my formula to 'paste special values' to preserve date formats?

    Thank you so much for your help! I shouldn't admit this but I was placing your string on the wrong cell. Sorry. Thanks so much for taking the time to help me, this makes a HUGE difference!

    Much appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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