#1   Report Post  
Posted to microsoft.public.excel.misc
CWillis
 
Posts: n/a
Default Text Box Length

I created a macro that auto sizes a text box. I would like for the macro to
tell me the length of that text box. (I believe this is simply the number of
characters in the text box.) How do I do this? Thanks in advance for any
suggestions.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ardus Petus
 
Posts: n/a
Default Text Box Length

The width (in points) will be returned by .Width property of the listbox.
Caution: if empty, the listbox seems to have a minimum width of 12.75
The width is dependent upon the characters' with with proportional fonts:
'0000000000 will give a larger width than iiiiiiiiii

HTH
--
AP


"CWillis" a écrit dans le message de
news: ...
I created a macro that auto sizes a text box. I would like for the macro
to
tell me the length of that text box. (I believe this is simply the number
of
characters in the text box.) How do I do this? Thanks in advance for any
suggestions.



  #3   Report Post  
Posted to microsoft.public.excel.misc
CWillis
 
Posts: n/a
Default Text Box Length

Can you give an example of the .width command? I can't get it to work. I
also can't get the .TextLength command to work. I'm not sure how to use it.
Here is the code that auto sizes the box.

Sub testing()

ActiveSheet.Shapes("Text Box 1").Select
With Selection
.AutoSize = True
End With

End Sub

Thanks.

"Ardus Petus" wrote:

The width (in points) will be returned by .Width property of the listbox.
Caution: if empty, the listbox seems to have a minimum width of 12.75
The width is dependent upon the characters' with with proportional fonts:
'0000000000 will give a larger width than iiiiiiiiii

HTH
--
AP


"CWillis" a écrit dans le message de
news: ...
I created a macro that auto sizes a text box. I would like for the macro
to
tell me the length of that text box. (I believe this is simply the number
of
characters in the text box.) How do I do this? Thanks in advance for any
suggestions.




  #5   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Text Box Length

Maybe this........

Sub size()
ActiveSheet.Shapes("Text Box 1").Select
With Selection
.AutoSize = True
MsgBox .Width
End With
End Sub

Vaya con Dios,
Chuck, CABGx3



"CWillis" wrote:

Can you give an example of the .width command? I can't get it to work. I
also can't get the .TextLength command to work. I'm not sure how to use it.
Here is the code that auto sizes the box.

Sub testing()

ActiveSheet.Shapes("Text Box 1").Select
With Selection
.AutoSize = True
End With

End Sub

Thanks.

"Ardus Petus" wrote:

The width (in points) will be returned by .Width property of the listbox.
Caution: if empty, the listbox seems to have a minimum width of 12.75
The width is dependent upon the characters' with with proportional fonts:
'0000000000 will give a larger width than iiiiiiiiii

HTH
--
AP


"CWillis" a écrit dans le message de
news: ...
I created a macro that auto sizes a text box. I would like for the macro
to
tell me the length of that text box. (I believe this is simply the number
of
characters in the text box.) How do I do this? Thanks in advance for any
suggestions.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am using wrap text in excel, so why isn't all my text wrapping? GatorDawg123 Excel Discussion (Misc queries) 2 May 6th 06 05:52 PM
truncating text strings of different lengths Funkey Excel Discussion (Misc queries) 7 March 29th 06 07:22 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 09:56 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 12:25 AM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM


All times are GMT +1. The time now is 11:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"