bsharath
asked on
Excel sheet find all rows which are colored and copy all contents in the row
Hi,
In the Excel sheet i want to find all rows which are colored and copy all contents in the row to a new sheet.
Regards
Sharath
In the Excel sheet i want to find all rows which are colored and copy all contents in the row to a new sheet.
Regards
Sharath
sorry
missed a next
Sub ACOPY()
s2row=1
For i=1 to Sheet1.UsedRange.Rows.Coun t
if Sheet1.Cells(i,1).Interior .Color <> RGB(255,255,255)
Sheet1.Rows(i).Copy Destination:= Sheet2.Rows(s2row)
s2row = s2row+1
End if
Next
End Sub
missed a next
Sub ACOPY()
s2row=1
For i=1 to Sheet1.UsedRange.Rows.Coun
if Sheet1.Cells(i,1).Interior
Sheet1.Rows(i).Copy Destination:= Sheet2.Rows(s2row)
s2row = s2row+1
End if
Next
End Sub
ASKER
I get an error.
Cant execute code in break mode.
Cant execute code in break mode.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
s2row=1
For i=1 to Sheet1.UsedRange.Rows.Coun
if Sheet1.Cells(i,1).Interior
Sheet1.Rows(i).Copy Destination:= Sheet2.Rows(s2row)
s2row = s2row+1
End if
End Sub