format last row on sheet with VBA macro
If which cell has a formula? If the cell in column A
Sub test()
With Worksheets("Sheet2")
With .Cells(.Rows.Count, 1).End(xlUp)
If Not .HasFormula Then
With .Resize(1, 8)
.Font.Bold = True
End With
End If
End With
End With
End Sub
If you're talking about the cells in Column A-H, format the ones w/o
formulas and skip those w/formulas, then try:
Sub test()
Dim rngCell As Range
With Worksheets("Sheet2")
For Each rngCell In .Cells(.Rows.Count, 1).End(xlUp).Resize(1, 8)
If Not rngCell.HasFormula Then
rngCell.Font.Bold = True
End If
Next rngCell
End With
End Sub
Or do mean something else?
"Calle" wrote:
Thx! Is there anyway to get it to ignore if tehre is a formula in that cell?
Regards Calle
|