+ Reply to Thread
Results 1 to 18 of 18

Copy rows based on cell content

Hybrid View

  1. #1
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: macro or vba code needed for copying rows based on cell content, Please Help!

    Hi

    had to add another column with list in w to tiigger the change event
    at the right time to capture the whole completed row .. not just when you reached the f column
    Private Sub Worksheet_Change(ByVal _
                        Target As Excel.Range)
        Dim myRange As Range
        Dim sheetname As String
     On Error Resume Next
        Set myRange = Intersect(Range("F2:F100"), Target)
        Set myRangeto = Intersect(Range("W2:W100"), Target)
       If Not myRangeto Is Nothing And Range("W" & Target.Row) = "Yes" Then
           Range("A" & Target.Row & ":V" & Target.Row).Copy Destination:=Sheets(Choose(Range("c" & Target.Row).Value, "gregg1", "ej1", "joey1", "jeff1", "tom1")).Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
        End If
      If Not myRange Is Nothing And Range("F" & Target.Row) = "4" Then
         Range("A" & Target.Row & ":V" & Target.Row).Copy Destination:=Sheets("closed1").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
      End If
    End Sub
    Attached Files Attached Files
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

+ 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