Forcing Input as Uppercase on User Form

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
 
F

Frank Kabel

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).
 
Top