none
Copy then Paste exact text into Excel RRS feed

  • Question

  • Not really sure how to describe this but I am trying to Copy a HTML table and Paste it into Excel.  Most values are correct when I paste but some are not.

    When trying to paste:

    1-7
    2-6
    3-5

    I end up getting:

    1-Jul
    2-Jun
    3-May

    And sometimes get just some random numbers.

    41646
    41676
    41703

    I know the one is a date but not sure about the other one.  Can someone tell me how to keep the "1-7" format?  Any help would be great!


    http://packer-madness.com

    • Moved by Carl Cai Tuesday, November 25, 2014 1:48 AM more related
    Monday, November 24, 2014 8:19 PM

Answers

  • Hi Michael,

    We can custom the format of the range by Range.NumberFormat. Here is a sample for your reference:

     Selection.NumberFormat = "d-m;@"
     

    Also we can record macros to get the correct format code we wanted.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 26, 2014 1:28 AM
    Moderator

All replies

  • Hi Michael Coomer,

    This forum is to discuss problems of Visual Basic. Your question is related to Excel.

    I've moved this thread to Excel For Develops where you could get better supports.

    Best regards,
    Youjun Tang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 25, 2014 1:56 AM
  • 1. Format the Excel destination cells as Text

    2. After the copy operation, switch to Excel and click the down-pointing arrow under the Paste icon.  Under Paste Options, click the second clipboard icon (Match Destination Formatting).

    3. After the paste operation has finished, you can switch back the cell format to General if you wish.



    Tuesday, November 25, 2014 2:43 AM
  • Hi Michael,

    We can custom the format of the range by Range.NumberFormat. Here is a sample for your reference:

     Selection.NumberFormat = "d-m;@"
     

    Also we can record macros to get the correct format code we wanted.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 26, 2014 1:28 AM
    Moderator