ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Shade Cells Yellows if Column (D) has a value of C in Cell (https://www.excelbanter.com/excel-programming/399088-shade-cells-yellows-if-column-d-has-value-c-cell.html)

Dean P.

Shade Cells Yellows if Column (D) has a value of C in Cell
 

Please help me put together a macro that will search Column (D), starting in
row 30 for a character 'C', if true then shade all cells in that row yellow
between Column D and Column AC and strike through all values in that same
range of Columns. Column D will have at the most one character in a row.

Thanks so much for the help.



JW[_2_]

Shade Cells Yellows if Column (D) has a value of C in Cell
 
Sub highlightStuff()
For i = 30 To Cells(Rows.Count, 4).End(xlUp).Row
If Cells(i, 4).Text = "C" Then
With Range(Cells(i, 4), Cells(i, 29))
.Interior.ColorIndex = 6
.Font.Strikethrough = True
End With
End If
Next i
End Sub

Dean P. wrote:
Please help me put together a macro that will search Column (D), starting in
row 30 for a character 'C', if true then shade all cells in that row yellow
between Column D and Column AC and strike through all values in that same
range of Columns. Column D will have at the most one character in a row.

Thanks so much for the help.




All times are GMT +1. The time now is 09:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com