PC Review


Reply
Thread Tools Rate Thread

Column Width Template Question

 
 
=?Utf-8?B?bWV0YWx0ZWNrcw==?=
Guest
Posts: n/a
 
      24th Aug 2007
I currently have a report that I export into Excel. The name of the Column is
Company Name. Sometimes the names are small and sometimes big. But the Column
Width always needs to stay at 50 characters wide. So if the name is only 10
characters wide, I still need the remaining 40 to show up in the column.
Since I export this every month, I would like to export this report into a
template that will give me the column size I need.

Is there a way to do this.

Thank you
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      24th Aug 2007
Columnwidths aren't measured in characters.

=rept("i",50)
is much skinnier than
=rept("W",50)
(in a non-proportional font)

If you use a proportional font (like Courier New), then they would be.)

I think I'd set the width manually or use a macro to make it exactly as wide as
I needed.

Set the width manually and then
Format|Column|width to see the current width that you need to use in the macro.

metaltecks wrote:
>
> I currently have a report that I export into Excel. The name of the Column is
> Company Name. Sometimes the names are small and sometimes big. But the Column
> Width always needs to stay at 50 characters wide. So if the name is only 10
> characters wide, I still need the remaining 40 to show up in the column.
> Since I export this every month, I would like to export this report into a
> template that will give me the column size I need.
>
> Is there a way to do this.
>
> Thank you


--

Dave Peterson
 
Reply With Quote
 
=?Utf-8?B?bWV0YWx0ZWNrcw==?=
Guest
Posts: n/a
 
      24th Aug 2007
I can do this, but my problem is when i click on the column heading to get
rid of the white space, it does. I don't want it to. I want the cells to be
locked with that width.
How can I do that?
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      24th Aug 2007
Not if you autofit the columns.

Maybe you could create a macro that autofits all the columns and comes back and
fixes that other column.

Something like:

Option Explicit
Sub testme()
With ActiveSheet
.UsedRange.Columns.AutoFit
.Range("c1").EntireColumn.ColumnWidth = 44
End With
End Sub

=====
Or put the longest name possible (or all x's or whatever) in a cell in that
column. Then hide that row.

Then autofitting of that column should respect that (hidden) cell's length.



metaltecks wrote:
>
> I can do this, but my problem is when i click on the column heading to get
> rid of the white space, it does. I don't want it to. I want the cells to be
> locked with that width.
> How can I do that?


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
column width VBA question Damian Microsoft Excel Misc 7 25th Sep 2009 09:41 PM
Create a macro which takes a column name and width and sets the column width to what it should be Ag Microsoft Excel Programming 4 29th Sep 2007 11:29 PM
setting Column width of Template Column in Datagrid.. Charleees Microsoft ASP .NET 2 20th Jun 2006 01:52 PM
subform column width question =?Utf-8?B?a3dfdWg5Nw==?= Microsoft Access Forms 0 5th Jun 2006 04:22 PM
Setting a column width of a Template column programatically =?Utf-8?B?Q29yZXlNYXM=?= Microsoft Dot NET 0 14th Mar 2005 03:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:46 AM.