Forum

Yellow Color Row Co...
 
Notifications
Clear all

Yellow Color Row Copy and Paste in Specific Sheet VBA

3 Posts
2 Users
0 Reactions
89 Views
(@kpmsivaprakasam2003)
Posts: 15
Eminent Member
Topic starter
 

Hi 

I am using Excel 2013

I have a lot of Audit observation sheet with BPO Name wise

In the BPO Name sheet, we highlight as in Yellow color as row, that Yellow color row Copy and one-down by one-down paste in "Y - Color" sheet

The File is enclosed for your reference

Thanks for Advance

 
Posted : 01/10/2020 9:35 am
(@purfleet)
Posts: 412
Reputable Member
 

I think you want alll the yellow rows copied from the various worksheets to the first work sheet? If so try this

Sub ListYellow()

Dim s As Worksheet
Dim sName As String

Dim NextRow As Long
Dim SheetLastRow As Long

Dim r As Range
Dim c As Range
Dim i As Integer

For Each s In ActiveWorkbook.Sheets

If s.Name = "Y - Color Data" Then
GoTo skipSheet
End If

SheetLastRow = s.Cells(Rows.Count, 2).End(xlUp).Row

Set r = s.Range("a1:a" & SheetLastRow)

For Each c In r
If c.Interior.Color = vbYellow Then

NextRow = Worksheets("Y - Color Data").Cells(Rows.Count, 2).End(xlUp).Row

c.EntireRow.Copy Worksheets("Y - Color Data").Range("a" & NextRow + 1)

End If

Next c

skipSheet:
Next s

End Sub

 
Posted : 01/10/2020 4:36 pm
(@kpmsivaprakasam2003)
Posts: 15
Eminent Member
Topic starter
 

Yes......!!!! perfectly it works, thanks so much, my time saved by you....!!!

 
Posted : 05/10/2020 10:46 pm
Share: