+ Reply to Thread
Results 1 to 11 of 11

Copy Columns based on multiple criteria

Hybrid View

slmthai Copy Columns based on... 06-18-2013, 08:46 PM
humdingaling Re: Copy Columns based on... 06-18-2013, 08:54 PM
slmthai Re: Copy Columns based on... 06-18-2013, 09:36 PM
humdingaling Re: Copy Columns based on... 06-18-2013, 10:17 PM
slmthai Re: Copy Columns based on... 06-18-2013, 10:58 PM
humdingaling Re: Copy Columns based on... 06-18-2013, 11:39 PM
slmthai Re: Copy Columns based on... 06-19-2013, 12:39 AM
humdingaling Re: Copy Columns based on... 06-19-2013, 01:16 AM
slmthai Re: Copy Columns based on... 06-19-2013, 01:50 AM
humdingaling Re: Copy Columns based on... 06-19-2013, 02:05 AM
slmthai Re: Copy Columns based on... 06-19-2013, 02:07 AM
  1. #1
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Columns based on multiple criteria

    Sub Active_sheet()
    
    ' copy_Active RAP to other sheet
    
    Set i = Sheets("PO_Status")
    Set e = Sheets("Active_sheet")
    Dim d, j As Integer
    
    
    d = 1
    j = 2
    
    Do Until IsEmpty(i.Range("F" & j))
    
        If i.Range("F" & j) = "Active" Then
        
            If InStr(1, i.Range("D" & j).Value, "Network") > 0 Or InStr(1, i.Range("D" & j).Value, "server") > 0 Or InStr(1, i.Range("D" & j).Value, "Rack") > 0 Then
                d = d + 1
                e.Rows(d).Value = i.Rows(j).Value
       
                i.Select
                Rows(j).Copy
                
                e.Select
                Rows(d).PasteSpecial
            End If
        End If
        j = j + 1
    Loop
    End Sub
    Don't think you can use OR the way you are using it
    also INSTR function as you are not doing exact match
    if string exist it would give a number so if number is greater than 0 then if loop is executed

    i separated your "active" loop so make it easier to follow
    Last edited by humdingaling; 06-18-2013 at 11:42 PM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ 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