Results 1 to 2 of 2

Thread: Copy Highlighted Cell to Another Worksheet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Copy Highlighted Cell to Another Worksheet

    I have tried doing this:

    Sub MoveHighlightedErrors()
    
    
    Dim rowIndex As Long
    
    
    rowIndex = 3
    
    
    
    
    With Sheets("Sheet1")
    
    
    For i = 4 To .Range("E4").CurrentRegion.Rows.Count
        If .Cells(i, 9).Interior.Color = 65535 And .Cells(i, 11).Interior.Color = 65535 Then
        Sheets("Sheet1").Range(.Cells(i, 5), .Cells(i, 11)).Copy Destination:=Sheets("Sheet2").Rows(rowIndex)
        rowIndex = rowIndex + 1
        End If
    Next i
    
    
    End With
    
    
    End Sub
    Which unfortunately doesn't work. I'm not sure how to properly read a highlighted cell.

    Columns I and K could be highlighted. If they are both highlighted, I want to copy columns E:K for that row, and copy it to Sheet2 starting on row 3.


    *Edit
    The highlighted cells are conditionally formatted
    Last edited by spencerp237; 03-23-2017 at 09:17 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •