Highlight entire row and move to bottom

Tarvalon

Board Regular
Joined
Jun 30, 2009
Messages
75
I need a function or conditional format that will highlight an entire row if cell J:J = "P" and move to the bottom of the data table. I am using Excel 2013.

Thanks in advance.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi.

If I needed to do this I think I would create a conditional format to highlight the row. Then create a macro that was triggered by a worksheet change event to move the rows with a "P" in.

I suspect you could select the rows to move then cut and paste them to the end. However, a possibly simpler solution would just be to sort the rows into order. If you can use column J directly then that will be easiest. Otherwise you will need either a custom sort list or a helper column. The sorting could be triggered by a worksheet change event to make it automatic.

Regards,
 
Upvote 0
Hi, thanks for the reply. I never thought of sorting. I always try to think of the complicated stuff that the easy stuff just doesn't occur to me.

I don't know how to create conditional formatting to highlight the entire row. I just know how to highlight the cell.

Thanks
 
Upvote 0
Hi.

I have to admit that me and Conditional Formatting don't always get on :)
Excel usually finds an excuse for not doing what I want it to.

However, the trick in this case is to:

1. Select all the data
2. Select Home-->Styles-->Conditional Formatting
3. Select "Use a formula to determine which cells to format"
4. Enter the formula as: =$J2="P"
(Note the "$" sign before the "J".)
5. Select the Format button
6. Set the format and click OK
7. Click OK again


If you prefer the macro approach, here is a recording I made using the range A2:J15:
Code:
Sub SetConditionalFormat()
    Range("A2:J15").Select
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$J2=""P"""
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 49407
        .TintAndShade = 0
    End With
End Sub
 
Upvote 0
I did your conditional formatting suggestions and it would turn the row above the color I needed. Any ideas?

I forget where to put macros in.

Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,214,887
Messages
6,122,095
Members
449,064
Latest member
Danger_SF

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