Highlight Rows with Condition

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Have you looked at Conditional Formatting?
Take a look in Excel's built-in Help files for details, explanations, and examples.
 
Upvote 0
Without looking at your sample...Supposed..

Code:
Sub Haylight()
if Range("A1") = "To be highlighted" then
Range("A1").EntireRow.Select
Selection.Interior.ColorIndex = 3 ' Red
EndIf
 
End Sub
 
Upvote 0
Hi Friends,

I desperately need a macro to Highlight /or separate rows when specific conditions met.

sample file enclosed. Link http://www.speedyshare.com/files/29614659/sample.xls

Any help highly appreciated.

With Best Regards,PM.

I downloaded your sample and here is the code to filter the MANGO item plus the other items in the Customer list then paste onto Sheet 3

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> Macro3()<br>    Range("D3").Select<br>    ActiveSheet.Range("$A$3:$E$30").AutoFilter Field:=4, Criteria1:="MANGO"<br>    ActiveSheet.Range("$A$3:$E$30").AutoFilter Field:=3, Criteria1:=Array("one", "RV", "sns"), Operator:=xlFilterValues<br>    Range("A3").CurrentRegion.Copy<br>    Sheets("Sheet3").Select<br>    ActiveSheet.Paste<br>    Sheets("Sheet1").Select<br>    Application.CutCopyMode = <SPAN style="color:#00007F">False</SPAN><br>    <br>    Range("A1").Select<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0
Hi Trevor,

Thanks for your response. Column 3 customers name. What if other customer ordered for the item.? 1 need t separate orders with only " Mango"
 
Upvote 0
If its only about the item then remove this line.

ActiveSheet.Range("$A$3:$E$30").AutoFilter Field:=3, Criteria1:=Array("one", "RV", "sns"), Operator:=xlFilterValues

So you would end up with this

Sub Macro3()
Range("D3").Select
ActiveSheet.Range("$A$3:$E$30").AutoFilter Field:=4, Criteria1:="MANGO"
Range("A3").CurrentRegion.Copy
Sheets("Sheet3").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Application.CutCopyMode = False

Range("A1").Select
End Sub
 
Upvote 0
Thanks again.

My aim is to separate orders having only one item "mango". see my sample only 4 lines, 3 orders having the item, that will be separated.
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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