View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Coder1215 Coder1215 is offline
external usenet poster
 
Posts: 12
Default Disable the redX in a form

On Jul 9, 7:16*pm, Ewing25 wrote:
Okay so i have a inputbox that pops up from this code.

Dim Message2, Title2, MyValue
* * *Message = "Please Enter Last 5 Digits of Your Card Number"
* * Title = "AMEX Number" *'<--Change
* * MyValue = InputBox(Message, Title)

*If MyValue = "" Then
* *Sheets("Expense Amex").Protect password:="welcome"
* Exit Sub

*End If

* * Range("Cardholder_Number").AutoFilter
* * Range("Cardholder_Number").AutoFilter Field:=1, Criteria1:=MyValue,
visibleDropDown:=False
* * Sheets("Expense Amex").Protect password:="welcome"
On Error Resume Next

What i want to do is make it so they cant press the red X in the top right
of the form. how do i do this?

Thanks,
Alex


Hi Alex,

Try to include following code in your form:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
'message maybe
End If
End Sub

regards

Peter