Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how do i set column widths
I want to set the column widths to various sizes. I have columns A thru P
with headers and I want to make a macro that sets the column width of each column to a certain size. For example column A 5.29 or 42 pixels, column B 16.00 or 117 pixels, etc. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how do i set column widths
Take a look at the ColumnWidth property.
-- HTH Bob Phillips (remove nothere from email address if mailing direct) "lpdarspe" wrote in message ... I want to set the column widths to various sizes. I have columns A thru P with headers and I want to make a macro that sets the column width of each column to a certain size. For example column A 5.29 or 42 pixels, column B 16.00 or 117 pixels, etc. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how do i set column widths
I looked it up in help and it did not help me. How do I write a macro that
will set the column widths as I described? "Bob Phillips" wrote: Take a look at the ColumnWidth property. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "lpdarspe" wrote in message ... I want to set the column widths to various sizes. I have columns A thru P with headers and I want to make a macro that sets the column width of each column to a certain size. For example column A 5.29 or 42 pixels, column B 16.00 or 117 pixels, etc. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
how do i set column widths
Help says it as far as I can see
columns(1).columnwidth = 8.43 as an example -- HTH Bob Phillips (remove nothere from email address if mailing direct) "lpdarspe" wrote in message ... I want to set the column widths to various sizes. I have columns A thru P with headers and I want to make a macro that sets the column width of each column to a certain size. For example column A 5.29 or 42 pixels, column B 16.00 or 117 pixels, etc. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
how do i set column widths
Record a macro when you set each columnwidth to what you want.
lpdarspe wrote: I want to set the column widths to various sizes. I have columns A thru P with headers and I want to make a macro that sets the column width of each column to a certain size. For example column A 5.29 or 42 pixels, column B 16.00 or 117 pixels, etc. -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
how do i set column widths
I tried that but it did not work either. It did not record anything.
"Dave Peterson" wrote: Record a macro when you set each columnwidth to what you want. lpdarspe wrote: I want to set the column widths to various sizes. I have columns A thru P with headers and I want to make a macro that sets the column width of each column to a certain size. For example column A 5.29 or 42 pixels, column B 16.00 or 117 pixels, etc. -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
how do i set column widths
I got this when I recorded a macro:
Option Explicit Sub Macro1() Columns("G:G").ColumnWidth = 11.29 Columns("D:D").ColumnWidth = 10.86 End Sub Maybe you can use it. (I'd try recording a macro once more. I'm guessing that you did something wrong the first time.) lpdarspe wrote: I tried that but it did not work either. It did not record anything. "Dave Peterson" wrote: Record a macro when you set each columnwidth to what you want. lpdarspe wrote: I want to set the column widths to various sizes. I have columns A thru P with headers and I want to make a macro that sets the column width of each column to a certain size. For example column A 5.29 or 42 pixels, column B 16.00 or 117 pixels, etc. -- Dave Peterson -- Dave Peterson |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
how do i set column widths
Thanks! I made it work using what you copied.
"Dave Peterson" wrote: I got this when I recorded a macro: Option Explicit Sub Macro1() Columns("G:G").ColumnWidth = 11.29 Columns("D:D").ColumnWidth = 10.86 End Sub Maybe you can use it. (I'd try recording a macro once more. I'm guessing that you did something wrong the first time.) lpdarspe wrote: I tried that but it did not work either. It did not record anything. "Dave Peterson" wrote: Record a macro when you set each columnwidth to what you want. lpdarspe wrote: I want to set the column widths to various sizes. I have columns A thru P with headers and I want to make a macro that sets the column width of each column to a certain size. For example column A 5.29 or 42 pixels, column B 16.00 or 117 pixels, etc. -- Dave Peterson -- Dave Peterson |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
how do i set column widths
Pardon me for 'piggybacking' on your thread lpdarspe; but how do I make it
stay once it formatted? Protecting the sheet isn't working as they remove it. Can I just tell it Sub stance() Range("A:A").ColumnWidth = 2 Range("B:B").ColumnWidth = 7 End Sub and so forth, will it automatically open and stay at this size? or is there something else I need to do to make this happen? "Dave Peterson" wrote: I got this when I recorded a macro: Option Explicit Sub Macro1() Columns("G:G").ColumnWidth = 11.29 Columns("D:D").ColumnWidth = 10.86 End Sub Maybe you can use it. (I'd try recording a macro once more. I'm guessing that you did something wrong the first time.) lpdarspe wrote: I tried that but it did not work either. It did not record anything. "Dave Peterson" wrote: Record a macro when you set each columnwidth to what you want. lpdarspe wrote: I want to set the column widths to various sizes. I have columns A thru P with headers and I want to make a macro that sets the column width of each column to a certain size. For example column A 5.29 or 42 pixels, column B 16.00 or 117 pixels, etc. -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Column Widths | Excel Worksheet Functions | |||
Different widths for each column in a 100% stacked column chart | Charts and Charting in Excel | |||
Column Widths | Excel Discussion (Misc queries) | |||
Column widths | Excel Worksheet Functions | |||
Column Widths help ? | Excel Programming |