Results 1 to 2 of 2

Copying rows in range based on criteria

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Copying rows in range based on criteria

    I have the following code written but it is not copying the correct cells. I would like to only copy rows in the row range 25:66 with "Buy" in column D and "Initiating" in column E. Can anyone help me modify this code? Thanks in advance.


    
    Private Sub getreport(Code As Integer)
    
        
    
        Range("A25").Select
        celltocopy = ("A25:IU25") & ActiveCell.Row
        Range(celltocopy).Select
        Selection.Copy
         If (ActiveCell.Offset(0, 3).Value = "Buy") And (ActiveCell.Offset(0, 4).Value = "Initiating") Then
            Range("A87").Select
            Selection.PasteSpecial paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    
    
       End If
       
        Do Until ActiveCell.Value = "Stop"
        OffsetRow = 0
        OffsetRow = OffsetRow + 1
            
        Loop
    Attached Files Attached Files

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