Forcing Input as Uppercase on User Form

  • Thread starter Thread starter robertguy
  • Start date Start date
R

robertguy

Hi

can any one advise me how to amend the following code to ensure :-

(a) only two letters are input

(b) they are converted to upper case

(c) how do you centre the text in a message box header as I have use
spaces to achieve this

Code used

inputVal = TextBox1

Do Until ActiveCell = inputVal

ActiveCell.Offset(1, 0).Select
If ActiveCell = "" Then
MsgBox ("Sorry Not Found - Please Input the first two letter
only e.g. RG ") ", vbInformation, "
Warning !! "
Unload UserForm1
UserForm1.Show
End
Else
End If
Loop



Excel version 2000


Many thanks for any help


Regards


Ro
 
Hi
a)
use something like
if len(result)<>2 then ....

b)
use result=ucase(result)

c) you can't with a messagebox (or at least not with a lot of API
tricks).
 

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

Back
Top