Re: Reduce Size of Blank Rows (again)
- From: Dave Peterson <petersod@xxxxxxxxxxxxxxxx>
- Date: Fri, 28 Mar 2008 12:45:18 -0500
First, what are you trying to do?
Are you changing the font size (for the characters) or the rowheight?
Second, I don't understand what "It still stops at the End If" statement means.
Maybe you could explain what you want and what is happening in a little more
detail.
Rebecca wrote:
Thanks, Dave, but it still doesn't work. It still stops at the End If. Do you
need more information about the work*** (for example, it contains a mixture
of unicode fonts and non-unicode fonts). Is that what's causing the problem?
As you can see, I am a new user and I'm unable to program a macro.
"Dave Peterson" wrote:
Your macro is changing the font for the cells in the empty rows.
That means that you really won't see anything until you type something in one of
those cells.
If you really wanted to change the rowheight of those empty rows to 8, you could
use:
Option Explicit
Sub Reduce_Height_of_Empty_Rows2()
Dim LastRow As Long
Dim I As Long
LastRow = Cells.SpecialCells(xlLastCell).Row
For I = LastRow To 2 Step -1
If Application.CountA(Rows(I)) = 0 Then
Rows(I).RowHeight = 8
End If
Next I
End Sub
Rebecca wrote:
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.
--
Dave Peterson
--
Dave Peterson
.
- Follow-Ups:
- Re: Reduce Size of Blank Rows (again)
- From: Rebecca
- Re: Reduce Size of Blank Rows (again)
- References:
- Reduce Size of Blank Rows (again)
- From: Rebecca
- Re: Reduce Size of Blank Rows (again)
- From: Dave Peterson
- Re: Reduce Size of Blank Rows (again)
- From: Rebecca
- Reduce Size of Blank Rows (again)
- Prev by Date: Re: Custom column widths
- Next by Date: Sumproduct Question #1
- Previous by thread: Re: Reduce Size of Blank Rows (again)
- Next by thread: Re: Reduce Size of Blank Rows (again)
- Index(es):