Hello!
I am working on a product that will help track when documents were filed. The idea is that when I type "Filed" in the cell next to "Remarks," then it will highlight that entire row, plus the row above and below it. After labeling everything, I'm going to set up a VBA to move the highlighted rows to another sheet.
So, I would like the conditional formatting to turn this:
Into this:
Currently, I have a VBA to set up the conditional formatting, but I can't figure out how to get it to highlight multiple rows. This is the VBA:
Which makes it look like:
Is it possible to make it highlight all three rows? Is there a better way to go about this? Any help would be appreciated!
I am working on a product that will help track when documents were filed. The idea is that when I type "Filed" in the cell next to "Remarks," then it will highlight that entire row, plus the row above and below it. After labeling everything, I'm going to set up a VBA to move the highlighted rows to another sheet.
So, I would like the conditional formatting to turn this:
Doc Number | Transaction Type | Operation Date | Operation No | NSN | Noun | Quantity | Created by |
XXXXXXXXXXXXXX | Consumption Issue | XXXXXXXXXXXXXX | XXXXXXXXXXXXXX | XXXXXXXXXXXXXX | XXXXXXXXXXXXXX | 2EA | XXXXXXXXXXXXXX |
Remarks: | |||||||
Into this:
Currently, I have a VBA to set up the conditional formatting, but I can't figure out how to get it to highlight multiple rows. This is the VBA:
VBA Code:
Sub ConFormat()
'
' Add Conditional Format
'
lastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
lastCol = ActiveSheet.Range("A:H").Column
Sheets("Document Status").Range("A4", Sheets("Document Status").Cells(lastRow, lastCol)).Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$B4=$B$2"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -11489280
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent6
.TintAndShade = 0.399945066682943
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub
Which makes it look like:
Is it possible to make it highlight all three rows? Is there a better way to go about this? Any help would be appreciated!