Results 1 to 8 of 8

Paste to a Dynamic range

Threaded View

abhitullu Paste to a Dynamic range 02-04-2011, 07:04 AM
pike Re: Pasting to a Dynamic range 02-14-2011, 02:40 AM
abhitullu Re: Pasting to a Dynamic range 02-14-2011, 06:47 AM
pike Re: Pasting to a Dynamic range 02-14-2011, 06:57 AM
abhitullu Re: Paste to a Dynamic range 02-14-2011, 07:39 AM
pike Re: Paste to a Dynamic range 02-14-2011, 07:47 AM
abhitullu Re: Paste to a Dynamic range 02-14-2011, 07:49 AM
abhitullu Re: Paste to a Dynamic range 02-14-2011, 08:10 AM
  1. #1
    Registered User
    Join Date
    02-04-2011
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Paste to a Dynamic range

    I want to copy a particular row (one that meets the "IF" criteria) from one workbook and paste it to a particular tab of another workbook. In the another workbook, where I intend to paste the copied row, I want to do it over a dynamic range,wherein I can vary the row number after completion of every "IF" loop.

    To do this I wanted to specify the cell locations in the range where the copied stuff is to be pasted.Here I want to keep incrementing the row by one unit every loop but want to keep the column number fixed.

    I am pasting the code below:

    Sub trial()
    
    Dim i As Integer
    Dim x As Integer
    Dim y As Integer
    Dim R As Range
    y = 20
    For i = 2 To 100
      x = Cells(i, 2)
     If x = 1 Then
      Range(Cells(i, 7), Cells(i, 16)).Copy
    
       Workbooks("Cardine5H.xlsx").Activate
          ActiveSheet.Paste Destination:=Worksheets("Jan-11").Range(Cells(y, 3), Cells(y, 12))
        y = y + 1
     End If
    
    Next i
    End Sub
    Last edited by abhitullu; 02-07-2011 at 08:27 AM. Reason: add code tags for newbie

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