Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Has Text Enough Space in a cell
Hello,
I would like to test if myValue has enough space (place) to be written in a cell. I know the width of my cell with Set selected_cell = Target.Cells(1, 1) Debug.Print selected_cell .Width What is the width of the value? Dim myValue as string myValue = "a value from database" selected_cell.value = myValue Reason: I would like that the whole value has place in the cell, otherwise I would shorten the value. I need A function like width(cell, myValue) this depends on the font in the cell Any Hints Thanks Marcel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Has Text Enough Space in a cell
I find it simpler to use Autofit.
"Marcel" wrote in message ... Hello, I would like to test if myValue has enough space (place) to be written in a cell. I know the width of my cell with Set selected_cell = Target.Cells(1, 1) Debug.Print selected_cell .Width What is the width of the value? Dim myValue as string myValue = "a value from database" selected_cell.value = myValue Reason: I would like that the whole value has place in the cell, otherwise I would shorten the value. I need A function like width(cell, myValue) this depends on the font in the cell Any Hints Thanks Marcel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Wildcard for space text space pattern | Excel Programming | |||
deleting space in cell behind text | Excel Discussion (Misc queries) | |||
Remove space from text in cell | Excel Programming | |||
Location of space in a text in a cell | Excel Worksheet Functions | |||
sperate from the space, in text, in the same cell | Excel Programming |