Public Sub BoldBlankRow()
Dim rngToCheck As Excel.Range
Set rngToCheck = Sheets("Sheet1").Range("A4:A1000")
rngToCheck.SpecialCells(xlCellTypeBlanks).EntireRow.Font.Bold = True
End Sub
or:
Code:Public Sub BoldBlankRow() Dim rngToCheck As Excel.Range Set rngToCheck = Sheets("Sheet1").Range("A4:A1000") [COLOR="#0000CD"]On Error Resume Next[/COLOR] rngToCheck.SpecialCells(xlCellTypeBlanks).EntireRow.Font.Bold = True [COLOR="#0000CD"]On Error GoTo 0[/COLOR] End Sub
I think I must be mis-understanding. This appears to me to be saying.Check if cell contains today's date then do the same - bold the raw.
If it not contains the date then put the date (dd.month format) and make the row bold ?
I think I must be mis-understanding. This appears to me to be saying.
If the cell contains today's date bold the row.
If the cell doesn't contain today's date then put today's date and bold the row.
The result would be all rows have today's date and bold. ??
Does this do what you want?Only need to bold the rows that missing date or have todays date. Or we need to insert todays date in empty cells of that column and make the row bold
Sub DateAndBold()
Dim rBlanks As Range
Application.ScreenUpdating = False
With Range("A1", Range("A" & Rows.Count).End(xlUp))
.Replace What:=Date, Replacement:="", LookAt:=xlWhole, SearchFormat:=False, ReplaceFormat:=False
On Error Resume Next
Set rBlanks = .SpecialCells(xlBlanks)
On Error GoTo 0
If Not rBlanks Is Nothing Then
With rBlanks
.EntireRow.Font.Bold = True
.Value = Date
End With
End If
End With
Application.ScreenUpdating = True
End Sub
Thank you for patience ) Almost yes. But I need to ignore the empty rows. Range is K9:K128Does this do what you want?
Sub DateAndBold()
Dim rArea As Range, rBlanks As Range
Application.ScreenUpdating = False
For Each rArea In Range("J9", Range("J" & Rows.Count).End(xlUp)).SpecialCells(xlConstants, xlNumbers).Areas
With rArea.Offset(, 1)
.Replace What:=Date, Replacement:="", LookAt:=xlWhole, SearchFormat:=False, ReplaceFormat:=False
On Error Resume Next
Set rBlanks = .SpecialCells(xlBlanks)
On Error GoTo 0
If Not rBlanks Is Nothing Then
With rBlanks
.EntireRow.Font.Bold = True
.Value = Date
End With
Set rBlanks = Nothing
End If
End With
Next rArea
Application.ScreenUpdating = True
End Sub