Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I concatenate up to 17 cells (Sheet1!B6 thru Sheet1!R6) into one large,
merged cell (Sheet2!R96). I want my macro to change the width of the merged cell (Sheet2!R96) depending upon how much text is concatenated. The merged cell could have as little as 20 characters and as many as 60 characters of text. Is there a way for a macro to "count" the number of characters in a cell or, some other way, to determine the amount of text within that cell and then adjust the width of the cell accordingly? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi crimsonkng
You can say x = Len(ActiveCell.Value) ActiveCell.ColumnWidth = x And possibly work out a conversion factor (once) if 5 characters does not necessarily look the best in five width-units. You might want to multiply x by 1/2, 1/4 etc. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Awesome. I'll try it. Thanks.
"KCarhart" wrote: Hi crimsonkng You can say x = Len(ActiveCell.Value) ActiveCell.ColumnWidth = x And possibly work out a conversion factor (once) if 5 characters does not necessarily look the best in five width-units. You might want to multiply x by 1/2, 1/4 etc. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
change zoom based on column width | Excel Discussion (Misc queries) | |||
Change Cell Width WITHOUT changing Column width | Excel Discussion (Misc queries) | |||
Change Line Width based on formula | Charts and Charting in Excel | |||
Need to write function that will change column width based on a condition | Excel Discussion (Misc queries) | |||
hOW DO i CHANGE COLUMN WIDTH FOR ONLY A SELECT RANGE OF CELLS? | Excel Discussion (Misc queries) |