Results 1 to 6 of 6

Do only copy the Colunms I:O.

Threaded View

  1. #1
    Registered User
    Join Date
    08-09-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    49

    Do only copy the Colunms I:O.

    I have made this code to copy conditionally into sheet(1). I basically copies the entire row into sheet(1) only of the rows that in Colunm I is between 10 - 200.
    Now I want to only copy the thing in that is from colunm I to O. And I want to copy it into sheet(1) in Range ("M20:S")

    Hope you understand my question.

    Best regards
    Esben

    Sub Copy()
    Dim cell As Range
    Dim LastRow As Long, i As Long
    
    Sheets(2).Activate
    LastRow = Range ("I" & Rows.Count).End(x1Up).Row
    i = 1
    
    For Each cell In Sheets(2).Range("I1:I" & LastRow)
         If cell.Value > 10 And cell.Value < 200 Then
             Cell.EntireRow.Copy Sheets(1).Cell( i, 1 )
            i = i + 1
            End If
         Next
    End Sub
    Last edited by Cutter; 08-19-2012 at 08:38 AM. Reason: Added code tags

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