Reduce Size of Blank Rows (again)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I am using MS Excel 2007. A month or so ago I asked for help to reduce the
size of blank rows (currently 16 points) down to 8 points. The Excel experts
advised me to try this macro:

Sub Reduce_Height_of_Empty_Rows()
'-- Reduce_Height_of_Empty_Rows to 8pts
' D.McRitchie, 2008-02-23 in excel.newusers
Dim LastRow As Long
Dim I As Long
' Cells.Font.Size = 16
LastRow = Cells.SpecialCells(xlLastCell).Row
For I = LastRow To 2 Step -1
If Application.CountA(Cells(I, 1).EntireRow) = 0 Then
Cells(I, 1).EntireRow.Font.Size = 8
End If
Next I
End Sub

Whenever I run this macro, it doesn't do the job intended (it's hard to
explain -- because I know nothing about programming -- but it looks like the
macro is running in loops -- the rows appear to be stuttering, but not
reducing the size from 16 to 8), and when I press Escape, the debug is yellow
highlight at the "End IF" line.

As I mentioned above I know absolutely nothing about macro creation, so I am
at a loss as to what the problem is. Could one of the MVP Excel experts take
a quick look again at the macro above and give me some advice? Thank you.

.



Relevant Pages

  • Re: Reduce Size of Blank Rows (again)
    ... These Excel discussion groups are indispensible, ... previous macros, when I run the macro you provided, the cells flicker / blink ... Dim LastRow As Long ... LastRow = Cells.SpecialCells.Row ...
    (microsoft.public.excel.newusers)
  • Re: Reduce Size of Blank Rows (again)
    ... of unicode fonts and non-unicode fonts). ... I am a new user and I'm unable to program a macro. ... Dim LastRow As Long ... LastRow = Cells.SpecialCells.Row ...
    (microsoft.public.excel.newusers)
  • Re: VBA: For Count, when count changes from cell to cell
    ... with Excel 2000. ... reporting Macro being unavailable. ... Sub CalculateI3() ... means that you can refer to it in a cell just like a built-in Excel function. ...
    (microsoft.public.excel.misc)
  • RE: Sorting macro needed on a protected sheet
    ... they all have Excel 2003, before reposting this thread as a new discussion to ... you will still be prompted to enter a password when running your macro even ... closing the password dialog box performed the sort macro anyway without ... Autofiltering can be restored without having to close & ...
    (microsoft.public.excel.programming)
  • Re: Reduce Size of Blank Rows (again)
    ... Dave, I apologize for not being more specific. ... I am using MS Excel 2007. ... wrong) the macro you provided is aimed at reducing the font size of the ... LastRow = Cells.SpecialCells.Row ...
    (microsoft.public.excel.newusers)