Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number of bytes in a string

Status
Not open for further replies.

MaharajanM

Programmer
Oct 9, 2002
10
JP
Hi Folks,

Itz a Q in VBA module.

How can i calculate total number of bytes in a string, when the string have 2 byte charactors and as well as single byte normal charactors?

Thx
Maharajan
 
How about something like this:

Code:
Function LenMbcs (ByVal str as String)
    LenMbcs = LenB(StrConv(str, vbFromUnicode))
End Function
VBSlammer
redinvader3walking.gif
 
Hi VBSlammer!

It works well. Thank you very much.

BTW, where can get info about compalte list of VB functions
like Split and StrConv

Thanks
Again
 
Using VBA Help Contents, go to:

[ul][li]-- Visual Basic Language Reference[/li]
[li]------ Functions[/li]
[li]---------- A-C[/li]
[li]---------- D-G[/li]
[li]---------- H-L[/li]
[li]---------- M-P[/li]
[li]---------- Q-Z[/li]


I also use the MSDN Library for more advanced topics.
VBSlammer
redinvader3walking.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top