ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do you insert into a excel cell the column width automaticall (https://www.excelbanter.com/excel-discussion-misc-queries/205451-how-do-you-insert-into-excel-cell-column-width-automaticall.html)

Paul

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

Jim Rech

how do you insert into a excel cell the column width automaticall
 
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
"Paul" wrote in message
...
| How do you insert into a excel cell automatically the column width?


Paul

how do you insert into a excel cell the column width automatic
 
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
"Paul" wrote in message
...
| How do you insert into a excel cell automatically the column width?



Jim Rech

how do you insert into a excel cell the column width automatic
 
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
"Paul" wrote in message
...
| 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
| "Paul" wrote in message
| ...
| | How do you insert into a excel cell automatically the column width?
|
|



All times are GMT +1. The time now is 06:10 PM.

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