ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Use VBA to change row height or width?? (https://www.excelbanter.com/excel-programming/436695-use-vba-change-row-height-width.html)

Robert Crandal

Use VBA to change row height or width??
 
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


Robert Crandal

Use VBA to change row height or width??
 
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 ToolsOptionsViewRow 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?



"JLGWhiz" wrote in message
...
Which headings are you referring to?

1. On the menu bar ViewHeader and Footer refers to the page header and
footer that prints out, not the row and column headers.

2. On the menu bar ToolsOptionsViewRow and Column Headers refers to
the letters and numbers along the top and left edge of the worksheet.
Checking the box will show these characters, unchecking will take them
away.

3. If you are referring to the header row(s) or column(s) that you
created, you will hide them to make them go away. They cannot be
controlled from with the View menu.



Billy Liddel

Use VBA to change row height or width??
 
Robert, is this what you want?

ActiveWindow.DisplayHeadings = Not ActiveWindow.DisplayHeadings

Toggles the row/column headers


HTH
Peter

"Robert Crandal" wrote:

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 ToolsOptionsViewRow 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?



"JLGWhiz" wrote in message
...
Which headings are you referring to?

1. On the menu bar ViewHeader and Footer refers to the page header and
footer that prints out, not the row and column headers.

2. On the menu bar ToolsOptionsViewRow and Column Headers refers to
the letters and numbers along the top and left edge of the worksheet.
Checking the box will show these characters, unchecking will take them
away.

3. If you are referring to the header row(s) or column(s) that you
created, you will hide them to make them go away. They cannot be
controlled from with the View menu.


.


Robert Crandal

Use VBA to change row height or width??
 
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???


"Billy Liddel" wrote in message
...
Robert, is this what you want?

ActiveWindow.DisplayHeadings = Not ActiveWindow.DisplayHeadings

Toggles the row/column headers





All times are GMT +1. The time now is 01:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com