View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen[_2_] Per Jessen[_2_] is offline
external usenet poster
 
Posts: 703
Default UserForm Option Button

Linda,

You are not testing if A3 is empty, but if it has a single space
character.

Try this (no space between the quotation signs):

If Range("A3") ="" then

Regards,
Per

On 6 Apr., 20:18, mathel wrote:
I am new to UserForms (Excel 2003). *I created a UserForm with 3 options that
input data into Cell A3 in a worksheet. *However, you can exit the Userform
by clicking 'OK' without selecting any of the options. *I need at least one
Option to be selected. *I thought the following Code would help, but doesn't.
*I am hoping someone can help.

Private Sub OK_Click()

If Range("A3") = " " Then
MsgBox "You Must Select the Source from this menu"
UserForm1.SetFocus

Exit Sub
* * End If

Unload Me

End Sub

Thanks
Linda