Sebhughes.com
Well-known Member
- Joined
- Oct 11, 2004
- Messages
- 650
can u have a drop down menu in a input box
Sub Confirm()
' Guest Confirmation'
Dim rngName As Range, intResponse
Dim strName As String
If Intersect(Selection, Range("B3:Ae14")) Is Nothing Then Exit Sub
If Selection.Rows.Count > 1 Then
MsgBox "Please Select 1 Room Only", 0, "Booking Error"
Exit Sub
End If
If Application.CountA(Selection) <> 0 Then
MsgBox "The 1 Or More Night(s) That You Have Selected Have Already Been Taken", 0, "Booking Error"
Exit Sub
End If
strName = InputBox("Please Enter Guest Names", "Peverel Hall Hotel - Guest Confirmation", Default:="Enter Guest Name Here")
On Error Resume Next
Set rngName = Range(strName)
If Err.Number = 0 Then ' no error, name already exists
MsgBox "You Have Made A Error While Entering Data." & vbCr & vbCr & _
"The Name You Have Enter Already Exist Please Enter A Different Name.", _
vbExclamation, "Naming Conflict"
Exit Sub
End If
On Error GoTo handler
ActiveWorkbook.Names.Add Name:=strName, RefersTo:=Selection
Selection.Interior.ColorIndex = 4
Selection.FormulaR1C1 = "C"
handler:
If Err.Number = 1004 Then
MsgBox "You Have Made A Error While Entering Data. Below Is A List Of Possible Errors" & vbCr & "" & vbCr & "1.You Have Entered No Data" & vbCr & "2.You Have Enterd More Than 1 Word", 0, "Error"
End If
End Sub
Sub newConfirm()
myinput = InputBox("Please Enter a C or an R", "Input")
If myinput = "C" Then
ActiveCell = myinput
ActiveCell.Interior.ColorIndex = 4
ElseIf myinput = "R" Then
ActiveCellR = myinput
ActiveCell.Interior.ColorIndex = 3
Else
MsgBox "You did not enter a C or an R"
End If
End Sub