Copy and Paste Coloured Rows into another Sheet into another Workbook

slohman

Board Regular
Joined
Mar 31, 2012
Messages
110
Code:
Sub Sample()Dim lastrow As Integer
Dim Rng As Range

'Workbook = Price List, Sheet Name "SpareParts"
lastrow = Sheets("Sheet2").Range("B65000").End(xlUp).Row 

    
    Application.ScreenUpdating = False
  
    For i = 1 To lastrow
        
       'Workbook = New Price List, Sheet Name "SpareParts"
        Set Rng = Sheets("sheet1").Range("B:B").Find(Sheets("Sheet2").Cells(i, 2))
        If Rng Is Nothing Then
            Sheets("SpareParts").Cells(i, 1).EntireRow.Interior.Color = vbRed
        End If
       
    ' Need to copy and paste the rows into Sheet 1 next blank row (would prefer the above to only color columns A:C) instead of entire row
    
    Next

Range(Selection, Selection.SpecialCells(xlLastCell)).Select
        With Selection.Font
        .Name = "Arial"
        .FontStyle = "Regular"
        .Size = 10
    End With

    Application.ScreenUpdating = True


End Sub
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,203,527
Messages
6,055,926
Members
444,835
Latest member
Jonaskr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top