User-Defined String Formats

S

Sasa

Where should I put "more than" or ">" symbol to change my
set string variable to upper case?

My code is:

Dim name as String

name = InputBox("Blah, blah...")
Selection.Text = name

Thanks.

Sasa
 
J

Jonathan West

Hi sasa

You don't use > for that at all.

I would recommend against using "Name" as a variable, as it is already a VBA
keyword. One of the benefits of using prefixes for variable names (e.g.
strName for a string variable) is that it becomes impossible accidentally to
duplicate an existing keyword

To change a string to all uppercase letters, you use the UCase$ function,
like this

Dim strName as String

strName = InputBox("Blah, blah...")
Selection.Text = Ucase$(strName)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top