+ Reply to Thread
Results 1 to 2 of 2

Copy Range Values

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    24

    Copy Range Values

    Hi

    I have a little routine that copies values from a range (kfromrange) to another range (ktorange) as follows:

    kRows = kfromrange.Rows.Count
    kCols = kfromrange.Columns.Count
    Set kzrange = ktorange.Resize(kRows, kCols)
    kzrange.Value = kfromrange.Value

    Problem is if excel recognises a cell's value as a potential date it changes it to a date. So a bank sort code of say 07-10-20 is changed to 44022 which with a format of dd/mm/yy is 10/07/20.

    How can I stop excel doing this and just paste the values. I can use copy and paste values but using range value method above is so much quicker.

    Thanks

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445

    Re: Copy Range Values

    Hi,

    You could set the destination range formatting to text before writing the cells?

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

+ 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. VBA copy based on a range (message box / user form) and copy values greater than 0
    By madi1004 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2020, 09:05 AM
  2. [SOLVED] Macro to copy cells from a selected range and just paste values back to that same range
    By catscats11 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-18-2019, 02:59 PM
  3. Replies: 8
    Last Post: 03-31-2015, 01:06 PM
  4. Loop through each folder copy values from range in file1 to named range in file2
    By dafella in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-16-2015, 05:19 PM
  5. Need help making a macro to copy range of values based on cell values.
    By zolton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-23-2013, 08:58 AM
  6. Replies: 3
    Last Post: 03-26-2013, 06:06 PM
  7. Match values in a range with another range and copy the adjacent column
    By xelmac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2012, 01:42 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