Results 1 to 5 of 5

Copy Range with variable

Threaded View

  1. #1
    Registered User
    Join Date
    11-27-2009
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    25

    Unhappy Copy Range with variable


    Sub CopyandTranspose
    Dim k As Integer, i As Integer
        i = 1
        For k = 1 To 76 Step 2
        
        Range("A1:G2").Select    ' here I want select A1-G7, A3-G9, A5-G11 .. so on
        Selection.Copy
        Cells(i, 10).Select
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _False, Transpose:=True
        i = i + 7
        Next k
    Sub

    I am trying to copy A1:G7 and paste it as transpose to say J1 ... I have 7 rows filled.. now I have to copy from A3-G9 and paste as J8 .. and like wise ..
    I am stuck at how to change the range with help of variables.
    my idea is
    for k = 1 to 100 step 2
    A[k]:G[k+1] ..
    how to write this piece with VBA ..

    Any help will be highly appreciated ..

    Thanks in advance

    Shammi
    Last edited by shammi_Raj; 11-27-2009 at 01:48 PM.

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