I'm trying to loop through all cells in a row and change the font size using the following criteria:
- If the font size is less than 10, then change the font size to 10
This works if all cells in the worksheet are the same font size. It returns null
if any of the cells in the sheet have a different font size. If I have a font size of 8 in A1 and a size of 20 in A2, there is no change.
Sub SetSheetFont(ws As Worksheet)
Dim x As Integer
Dim NumRows As Long
Application.ScreenUpdating = False
NumRows = Range("A1", Range("A1").End(xlDown)).Rows.Count
Range("A1").Select
With ws
' If the font size is lower than 10, set to 10
For x = 1 To NumRows
If .Cells.Font.Size < 10 Then .Cells.Font.Size = 10
ActiveCell.Offset(1, 0).Select
Next
Application.ScreenUpdating = True
End With
End Sub
The end goal is to loop through all cells in the column until there is a certain number of empty cells, then start on the next column (in this case B1).
How might I at least accomplish this in one column? I'm pretty sure I can get it working if I start there.