+ Reply to Thread
Results 1 to 5 of 5

Range offset copy and paste

  1. #1
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Range offset copy and paste

    The following lines are part of a long section of code which extracts data from one workbook to another. This specific section is responsible for finding cells in Column K which dont have any formula, and in those cases it copies over the data in that cell (as without the formula the data won't get generated automatically). I am trying to take the code further so in the same circumstances when F does not contain formula to also copy over the data in K, but I'm not having any success. The lines I'm working on are in bold:

    Please Login or Register  to view this content.
    Thanks,
    James

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Range offset copy and paste

    Hello Nitefox,

    You can assign values values and formulas to cells directly. You don't need to copy and paste unless you need to preserve formatting or perform an operation like transposing the data.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Re: Range offset copy and paste

    I do need to preserve formatting.
    There still seems to be something up with the code to copy offset(0, 5) as even when I use your code to assign values instead of pasting special it still isn't copying over data in K, just in F.
    Last edited by Nitefox; 11-01-2014 at 06:45 PM.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Range offset copy and paste

    Hello Nitefox,

    You should post your workbook.

  5. #5
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Re: Range offset copy and paste

    I just figured it out, for some reason it was copying from J (one cell to the left of what I wanted, which is currently mostly blank). I can't figure out why as K is 5 columns over from F, but when I changed it to a 0,6 offset it copied from F.

+ 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. Copy range to existing workbook and paste with an offset
    By windowshopr in forum Excel General
    Replies: 1
    Last Post: 04-16-2014, 11:39 AM
  2. VBA code to copy cell formats and paste using offset for Rows/Range
    By spenlinhauer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2014, 07:45 PM
  3. Copy from Array in ActiveWorkbook to ThisWorkbook; Transpose copy, Offset Paste
    By sbradley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2013, 05:17 PM
  4. Dynamic offset range copy/paste
    By elxan0611 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2010, 04:45 AM
  5. Copy range, offset, then paste
    By WillysK5 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-11-2009, 10:55 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