+ Reply to Thread
Results 1 to 3 of 3

Is it a correct way to count the number of characters in a string

  1. #1
    Registered User
    Join Date
    01-27-2009
    Location
    Australia
    MS-Off Ver
    Excel 2002, 2010
    Posts
    42

    Is it a correct way to count the number of characters in a string

    Hi all,

    I got a question when I was doing a very simple macro program.
    I got three Strings as follows:

    String1 = "ABC"
    String2 = "你們好"
    String3= "にっぽん"

    Dim daysLengthString As String
    Dim daysLength As Variant

    daysLengthString = String1
    daysLength = Len(daysLengthString)

    MsgBox "The text " & daysLengthString1 & " is " & (daysLength) & " characters long"
    MsgBox "The text " & daysLengthString2 & " is " & (daysLength) & " characters long"
    MsgBox "The text " & daysLengthString3 & " is " & (daysLength) & " characters long"

    Please give me some suggestion how to improve the program.

    Thank you

    Kitty.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Is it a correct way to count the number of characters in a string

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Is it a correct way to count the number of characters in a string

    kwfine;

    I think your problem is obvious, but it's against the rules to answer you until you correct the infraction.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

+ 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