+ Reply to Thread
Results 1 to 7 of 7

Counting Characters In Textbox Including Spaces?

  1. #1
    Registered User
    Join Date
    10-21-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    94

    Counting Characters In Textbox Including Spaces?

    Hello

    Im trying to count the total characters in a textbox

    Please Login or Register  to view this content.
    This works great but doesnt count the spaces in the count.

    Can anyone suggest how to count all characters inside a textbox?

    Thanks

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,093

    Re: Counting Characters In Textbox Including Spaces?

    Maybe

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,030

    Re: Counting Characters In Textbox Including Spaces?

    How about
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Counting Characters In Textbox Including Spaces?

    It doesn't count them since your code is excluding the spaces from the text box

    Use

    lblWord_count.Caption = Len(txtbox_textcheck) & " chars used."
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    10-21-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    94

    Re: Counting Characters In Textbox Including Spaces?

    Thanks this works perfectly :-)

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,093

    Re: Counting Characters In Textbox Including Spaces?

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,030

    Re: Counting Characters In Textbox Including Spaces?

    Glad to help & thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Text on value field but including blank spaces
    By Alaztor in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-17-2020, 05:04 PM
  2. [SOLVED] Excel VBA form - textbox to export data over 255 characters from textbox
    By DannyJ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-21-2017, 05:52 AM
  3. [SOLVED] Drop down list. Entries including numbers and spaces
    By kollsvein in forum Excel General
    Replies: 15
    Last Post: 04-07-2015, 04:08 AM
  4. Length of a cell with fixed characters including spaces
    By treboll in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-19-2013, 02:59 PM
  5. [SOLVED] VBA Code for Textbox: First 3 characters Alphabets next 3 characters numeric
    By honger in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-11-2013, 01:05 AM
  6. [SOLVED] Keep first 11 characters (including spaces) in a column.
    By janlee43 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-06-2013, 05:17 PM
  7. Including spaces in filters
    By steev_jd in forum Excel General
    Replies: 5
    Last Post: 11-02-2012, 06:16 AM

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