Tuesday, August 2, 2011

How to display a string(say for example "Quick Test Professional") vertically in a message box?

Dim MyString, MyVar, i, S

MyString="Quick Test Professional"

For i=1 to Len(MyString)

'Get a new character for each iteration into S

S=Mid(MyString, i, 1)

'Add a character to MyVar and then add a new line. VBCRLF stands for Visual Basic Carriage Return Line Feed

MyVar=MyVar & S & VbCrlf

Next

Msgbox MyVar


No comments:

Post a Comment