Results 1 to 5 of 5

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

Threaded View

ChrisHook Use Offset and Variable to... 11-25-2015, 01:21 AM
AlphaFrog Re: Use Offset and Variable... 11-25-2015, 02:02 AM
humdingaling Re: Use Offset and Variable... 11-25-2015, 02:07 AM
Leith Ross Re: Use Offset and Variable... 11-25-2015, 02:33 AM
ChrisHook Re: Use Offset and Variable... 12-01-2015, 03:44 PM
  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.

    Sub copyover()
    
    Dim i As Variant
    i = Sheets("Sheet1").Range("H2")
    Select Case i
    Case Is = 1
    
    Cells(1, 1).Activate
    ActiveCell.Value = "Test"
    
    Case Else
    Sheets("Sheet2").Activate
    Range(Range("G2").Offset(0, i), Range("G2").Offset(5, i)).copy
    
    Sheets("Sheet1").Activate
    Cells(2, 10).PasteSpecial xlPasteValues
    End Select
    
    
    End Sub
    Many Thanks
    Attached Files Attached Files

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