Something Like :-
Code:Private Sub CommandButton1_Click() CommandButton1.Caption = "This" & vbLf & "Button" & vbLf & "Is" & vbLf & "CommandButton1" End Sub
Private Sub CommandButton1_Click()CommandButton1.Caption = "This" & vbLf & "Button" & vbLf & "Is" & vbLf & "CommandButton1"
End Sub
Do you mean you want every letter to be listed one below the other, or does the code not produce the text in the code ???
Please show what you expect to see in the Command Button.
[COLOR="Navy"]Sub[/COLOR] MG28Jun54
[COLOR="Navy"]Dim[/COLOR] nstr [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]String,[/COLOR] n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]For[/COLOR] n = 1 To Len("Test Text")
nstr = nstr & IIf(nstr = "", Mid("Test Text", n, 1), Chr(10) & Mid("Test Text", n, 1))
[COLOR="Navy"]Next[/COLOR] n
CommandButton1.Caption = nstr
'[COLOR="Green"][B]NB:- The code line below will fill a Forms "Button" if required.[/B][/COLOR]
'[COLOR="Green"][B]ActiveSheet.Shapes("Button 3").OLEFormat.Object.Caption = nstr[/B][/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
If you are using an ActiveX command button, then use these two lines of code in whatever procedure you plan to initialize the command button with...I have applied the code to the button as in post #3
leaving at default Command Button that is what i see left to right.
I changed it to TEST TEXT but still left to right.
I thought it would be
T
E
S
T
T
E
X
T
CommandButton1.WordWrap = True
CommandButton1.Caption = Replace(StrConv("TEST TEXT", vbUnicode), Chr(0), vbLf)