+ Reply to Thread
Results 1 to 7 of 7

Format destination data

  1. #1
    Registered User
    Join Date
    04-27-2019
    Location
    Northern Ireland
    MS-Off Ver
    2019
    Posts
    62

    Format destination data

    First here is code currently being executed:

    Please Login or Register  to view this content.

    Originally the source was source.Range("D4:D1858").Copy

    Then I added colE E4:E1858

    The problem is colE is a percentage field, whereas colD is a numbers field.

    I am not quite sure how to go about formatting this additional field. Perhaps there is a different approach I should be taking.

    Any help would be most appreciated.

    Patrick
    Last edited by gotroots; 05-31-2020 at 12:45 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: Format destination data

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,571

    Re: Format destination data

    Maybe use xlPasteValuesAndNumberFormats


    Administrative Note:
    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional.)
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    897

    Re: Format destination data

    Percentages are really numbers too. Try to treat them as numbers, then at the end format them back: Selection.Style = "Percent"

  5. #5
    Registered User
    Join Date
    04-27-2019
    Location
    Northern Ireland
    MS-Off Ver
    2019
    Posts
    62

    Re: Format destination data

    Terribly sorry about that Alan, will pay more attention to the rule the next time.

  6. #6
    Registered User
    Join Date
    04-27-2019
    Location
    Northern Ireland
    MS-Off Ver
    2019
    Posts
    62

    Re: Format destination data

    Simple enough solution in the end, many thanks.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,571

    Re: Format destination data

    Simple enough solution in the end
    You had two solutions suggested; which was the one used?

+ 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. Export Data From one source to multiple destination"Destination not in the same format"
    By Ali Rashed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-25-2017, 06:52 AM
  2. Replies: 2
    Last Post: 07-12-2016, 02:56 PM
  3. Problem with destination format paste
    By leafs4life22 in forum Excel General
    Replies: 9
    Last Post: 07-13-2013, 02:50 AM
  4. Replies: 0
    Last Post: 03-05-2013, 07:34 PM
  5. Get data from source workbook and paste to destination in change format
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2012, 01:47 AM
  6. AutoFill Destination but use cell format from cells above
    By excel0831 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-21-2012, 03:15 PM
  7. [SOLVED] Format date in destination cell
    By Susan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-05-2006, 07:10 PM

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