Use VBA to change row height or width??

R

Robert Crandal

I know how to change the width of a column by using the
following code:

Columns(1).ColumnWidth = 14

The problem is that I can't seem to find an equivalent
way to change the dimension of a row. Is there
an equivalent Rows() object that I can use in a similar manner?

thankx
 
R

Robert Crandal

I'm referring to the letters/numbers on the top and left edge of the
worksheet.

Run this code somewhere in a VBA module:

Rows(1).RowHeight = 30

Now, on the menu bar click Tools>Options>View>Row and Column Headers.
In my version of Excel it won't let me "uncheck" the option that says
"Headings" to off the row or column headings.

Does anybody know what's going on here?
 
B

Billy Liddel

Robert, is this what you want?

ActiveWindow.DisplayHeadings = Not ActiveWindow.DisplayHeadings

Toggles the row/column headers


HTH
Peter
 
R

Robert Crandal

Ya, that's perfect. I just dont understand why Excel wont let me
uncheck the "Headings" box normally after I run the following
code:

Rows(1).RowHeight = 30

Maybe it's an Excel bug or something???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top