+ Reply to Thread
Results 1 to 5 of 5

Use Offset and Variable to Copy and Paste Range in a different Worksheet

  1. #1
    Registered User
    Join Date
    10-14-2015
    Location
    East Coast
    MS-Off Ver
    2013
    Posts
    69

    Use Offset and Variable to Copy and Paste Range in a different Worksheet

    Hi all,

    Pretty simple problem here, but for some reason I seem I am not getting it. I'm trying to select a range in Sheet 2 using Offset, with the column being offset by a cell value in Sheet 1. Then paste that range into Sheet 1. I've included by code below, and the worksheet is attached.

    I would prefer to use the select method below, as this is a requirement of my project.

    Please Login or Register  to view this content.
    Many Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Use Offset and Variable to Copy and Paste Range in a different Worksheet

    You have the code located in the Sheet1 worksheet code module. It should go in a standard code module e.g.; Module1. Once moved to a standard code module, it seems to work as expected.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Use Offset and Variable to Copy and Paste Range in a different Worksheet

    Please Login or Register  to view this content.
    even though you activate sheet 2 it still copies off sheet1 (or whatever sheet is active at time of running)

    maybe something like this would fix it

    Please Login or Register  to view this content.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  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: Use Offset and Variable to Copy and Paste Range in a different Worksheet

    Hello ChrisHook,

    This working macro has been relocated into a Standard VBA module. It has been added to the attached workbook.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    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!)

  5. #5
    Registered User
    Join Date
    10-14-2015
    Location
    East Coast
    MS-Off Ver
    2013
    Posts
    69

    Re: Use Offset and Variable to Copy and Paste Range in a different Worksheet

    That all works great! Thank you!

+ 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. [SOLVED] Help! - Copy Range (Sheet1,A10:F50), Paste Range (Sheet 2,A1:F41), Offset Range & Repeat
    By cjtimmer in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-30-2015, 06:27 PM
  2. [SOLVED] Range offset copy and paste
    By Nitefox in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2014, 02:17 PM
  3. Copy Range with Offset Variable and Clear Data
    By ptmuldoon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2014, 09:59 AM
  4. [SOLVED] Copy/Paste Values from Variable Range to Corresponding Variable Range
    By Cpetersoc in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-14-2012, 08:20 AM
  5. Copy+Paste variable range from different sheets in a worksheet
    By Rosixks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2011, 02:09 PM
  6. Dynamic offset range copy/paste
    By elxan0611 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2010, 04:45 AM
  7. Copy range, offset, then paste
    By WillysK5 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-11-2009, 10:55 AM

Tags for this Thread

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