+ Reply to Thread
Results 1 to 3 of 3

Very easy problem : Pasting each cell in a given range with offset

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Very easy problem : Pasting each cell in a given range with offset

    Hi everyone,

    i just can't see what I'm doing wrong here:

    Sub CopyData()
    
    Dim Wklej As Range
    Dim Cell As Range
    Set Wklej = Application.Range("I1")
    
    
    For Each Cell In Application.Range("G7:G30")
    
        Cell.Copy Wklej
            Wklej = Wklej.Offset(1, 1)
                Next Cell
                    
    
    End Sub
    I just want to Copy each Cell from G7:G30 and paste it with an offset of (1,1) begining with Cell "I1".

    Thanks!

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Very easy problem : Pasting each cell in a given range with offset

    As you did before you need the Set statement:
    Set Wklej = Wklej.Offset(1, 1)
    Last edited by StephenR; 03-29-2012 at 10:38 AM.

  3. #3
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Very easy problem : Pasting each cell in a given range with offset

    I could, but I need the offset function. Thanks a lot! I was indeed missing the "Set" :/

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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