Hi JoeOriginally Posted by Joe Spy
Have a look here for 2 methods
I want to highlight the entire row where a selected cell is. For instance, I select a cell in row 5, I want the entire row to be highlighted. If I then select a cell in Row 8, I want Row 5 to return to normal, and Row 8 to be highlighted.
Thanks for the link. However, the code there doesn't quite do what I want it to do. I will take a stab at it, though, on a test workbook.
I only want this to work on a specific sheet in my workbook...not all sheets.
Place the code in the Worksheet that you want it to work in....post back if you require help
Ivan F Moala From the City of Sails
Thanks for the help. I did paste the code in the right place. It worked as advertised, but it wasn't what I wanted. I instead changed the Range to look like the following:
Range("A" & Target.Row, Target.EntireRow)
This fixed the problem and selects the entire row of the selected cell. PERFECT!
I only want this to work on a specific sheet in my workbook...not all sheets.[/QUOTE]
Try this code:
VB:Private Sub Worksheet_SelectionChange(ByVal Target As Range) ActiveSheet.Rows(Target.Row).Select ' highlite entire row Target.Activate ' select the cell End Sub
Last edited by royUK; December 31st, 2005 at 18:10. Reason: add code tags
Here is an easy way for coloring the corresponding row of your selected cell
1. Choose an empty cell on your worksheet (e.g. $A$200 in this example)
2. Place this code in the Worksheet_SelectionChange event:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.Range("A200").Value = Target.Row
The code will set the row value in the spefified cell ($A$200) each time a cell is selected
3. Set a Conditional formatting rule for all cells you want to highlight:
set the conditional formatting-formula as follows:
Hey newbie here haha. I would very much appreciate some help with highlighting rows in excel whenever the characters: "Rx", "R", "C", and "S" are entered down column A8 - A (any #).
I would to highlight the rows: RX - Red; R - Orange; C - Green and ; S- Yellow. I would appreciate the VBA code as I continually keep screwing it up haha. Thanks in advance
You can use conditional formatting to do that. You'll need to lock the comparison to the first column and apply it to the rows you want starting with row 8. The formula and applies to sections should be something like: =$A8="RX" and: Sheet1!$8:$999 respectively.
There are currently 1 users browsing this thread. (0 members and 1 guests)