how do you insert into a excel cell the column width automaticall

J

Jim Rech

This formula returns the column width of the cell it is in: =CELL("width")

It rounds to the nearest integer however. If you wanted something more
exact you'd have to use a macro. If you put this in a standard module:

Function ColWidth()
Application.Volatile
ColWidth = Application.ThisCell.ColumnWidth
End Function

Then you can enter =ColWidth() in a cell.
 
P

Paul

Hi, I am not very macro efficient. Can you advise how I set it up and
include it as a tool bar button.

Thanks
 
J

Jim Rech

If you want a message box to pop up with the current column's width you
don't really need one. Just click on the column separator at the top of the
worksheet. For instance, to see column A's width just click and hold on the
bar between "A" and "B".

--
Jim
| Hi, I am not very macro efficient. Can you advise how I set it up and
| include it as a tool bar button.
|
| Thanks
|
| "Jim Rech" wrote:
|
| > This formula returns the column width of the cell it is in:
=CELL("width")
| >
| > It rounds to the nearest integer however. If you wanted something more
| > exact you'd have to use a macro. If you put this in a standard module:
| >
| > Function ColWidth()
| > Application.Volatile
| > ColWidth = Application.ThisCell.ColumnWidth
| > End Function
| >
| > Then you can enter =ColWidth() in a cell.
| >
| > --
| > Jim
| > | > | How do you insert into a excel cell automatically the column width?
| >
| >
 

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