+ Reply to Thread
Results 1 to 6 of 6

Text Box Length

  1. #1
    CWillis
    Guest

    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. #2
    Ardus Petus
    Guest

    Re: 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" <[email protected]> a écrit dans le message de
    news: [email protected]...
    >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. #3
    CWillis
    Guest

    Re: 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" <[email protected]> a écrit dans le message de
    > news: [email protected]...
    > >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.

    >
    >
    >


  4. #4
    Ardus Petus
    Guest

    Re: Text Box Length

    Sub testing()

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

    End Sub

    HTH
    --
    AP


    "CWillis" <[email protected]> a écrit dans le message de
    news: [email protected]...
    > 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" <[email protected]> a écrit dans le message de
    >> news: [email protected]...
    >> >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. #5
    CLR
    Guest

    Re: 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" <[email protected]> a écrit dans le message de
    > > news: [email protected]...
    > > >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.

    > >
    > >
    > >


  6. #6
    CWillis
    Guest

    Re: Text Box Length

    Thank you very much Ardus and CLR. I will try and go from there.

    "Ardus Petus" wrote:

    > Sub testing()
    >
    > ActiveSheet.Shapes("Text Box 1").Select
    > With Selection
    > .AutoSize = True
    > msgbox "Width = " & .Width
    > End With
    >
    > End Sub
    >
    > HTH
    > --
    > AP
    >
    >
    > "CWillis" <[email protected]> a écrit dans le message de
    > news: [email protected]...
    > > 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" <[email protected]> a écrit dans le message de
    > >> news: [email protected]...
    > >> >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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1