Hello,
I have a simple excel sheet with all of 2017 calendar dates on it from A5:A369. When I open the excel sheet, it finds today's date in column A and bolds the cell, increases the size and borders it.
1. What I would like to add to the current code is: once it finds the date, I would like to apply all the changes that occur in Column A (bold, size and border) through Column F instead of just one column. I can't seem to figure out how.
2. Finally, if within the row there is a specific word in column D, I would like the column A:F of that row to be highlighted a certain color.
here is what I have so far:
Any help would be much appreciated, Thanks
I have a simple excel sheet with all of 2017 calendar dates on it from A5:A369. When I open the excel sheet, it finds today's date in column A and bolds the cell, increases the size and borders it.
1. What I would like to add to the current code is: once it finds the date, I would like to apply all the changes that occur in Column A (bold, size and border) through Column F instead of just one column. I can't seem to figure out how.
2. Finally, if within the row there is a specific word in column D, I would like the column A:F of that row to be highlighted a certain color.
here is what I have so far:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For Each cell In ActiveSheet.Range("A1:A400")
If cell.Value = [Today()] Then
cell.Borders(xlDiagonalDown).LineStyle = xlNone
cell.Borders(xlDiagonalUp).LineStyle = xlNone
With cell.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThick
End With
With cell.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThick
End With
With cell.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThick
End With
With cell.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThick
End With
With cell.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThick
End With
With cell.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThick
End With
cell.Font.Size = 14
cell.Font.Bold = True
Dim squadron As String
Select Case squadron
Case "Test1"
EntireRow.Interior.Color = 8
Case "Test2"
EntireRow.Interior.Color = 9
End Select
End If
Next
End Sub
Any help would be much appreciated, Thanks