Rather than coding it, why not use the built-in conditional formatting? If you are willing to go this direction, with Cell A1655 active (for example):
1. Click the Home Tab >> Conditional Formatting >> New Rule >> 'Use Formula to Determine Which Cells to Format'
2. Enter the formula =IF(A1655)<>"" (if you click choose the cell, it will make an absolute reference to the cell ($A$1655). In this case you will need to remove the $ if your wish is to format paint this conditional formatting to additional cells).
3. With the dialog box still open, choose Format button >> Select Yellow Color >> Click OK.
You can now format paint (paint brush in Clipboard group of Home Tab) this cell down and up as applicable if your desire is to always have the A column appear Yellow (highlighted) if a name is chosen in column F.
In your second question, you could also use conditional formatting, but if you're after vba:
Notes: Make a copy of your workbook and run the code on the copy first as a test. VBA is very difficult to undo. The following code will apply entire row highlighting to all rows in which an X is entered in the corresponding Column H.
Sub HighlightRow()
Dim ws As Worksheet
Dim rngCell As Range
Dim rngSource As Range
Dim lngLastRow As Long
Set ws = ThisWorkbook.Sheets("Production Log")
With ActiveSheet
lngLastRow = .Cells(.Rows.Count, "H").End(xlUp).Row
End With
Set rngSource = Range("H22", "H" & lngLastRow)
Application.ScreenUpdating = False
For Each rngCell In rngSource
If rngCell <> "" Then
rngCell.EntireRow.Interior.Color = 65535
Else
End If
Next
Application.ScreenUpdating = True
End Sub
Bookmarks