I have the code below that takes the user input from a text box "strtraveler" (a traveler number typicall looks like 12345p678and finds what the user inputs on the sheet and moves it to another area then deletes it from its previous area. This is case sensitive and I don't want it to be, sometimes what is on the sheet will have an upper case "P" or lower case "p" and if what the user types in doesn't fully mactch it won't move/clear out the traveler. Is there a way for the code to recognize the string as being the same whether the "p" in the middle is upper or lower case and execute?
Sub assignjobtomachine2()
Application.ScreenUpdating = False
Dim rnum As Integer
rnum = 22
Dim strtraveler As String
strtraveler = InputBox("Please enter the traveler number " & _
"you would like to assign to the machine.", "Assign:")
If strtraveler <> "" Then
Sheets("Machine 2 Schedule").Unprotect "gxs"
'Clears out job from "Not Yet Assigned To Machine" schedule and places
'it on Machine #2 - (Aerospace Jobs) schedule
Do Until rnum = 300
If Cells(rnum, 4) = strtraveler Then
If Cells(16, 3).Value > "" Then
MsgBox "Only 4 jobs can be assigned to a machine at once.", vbExclamation, "Error.."
Exit Sub
End If
Cells(rnum, 3).Copy
Call assignjobnumber
Cells(rnum, 4).Copy
Call assigntravelernumber
Cells(rnum, 5).Copy
Call assignassemblynumber
Cells(rnum, 6).Copy
Call assignquantity
Cells(rnum, 7).Copy
Call assigntimein
Cells(rnum, 8).Copy
Call assignduedate
Range((Cells(rnum, 2)), (Cells(rnum, 8))).Select
Selection.Delete shift:=xlUp
Call priority
Call formatmachinejobs
ElseIf Cells(rnum, 4) <> strtraveler Then
rnum = rnum + 1
End If
Loop
End If
'call lockdown
ThisWorkbook.Save
End Sub
Any help would be great, thanks.
Sub assignjobtomachine2()
Application.ScreenUpdating = False
Dim rnum As Integer
rnum = 22
Dim strtraveler As String
strtraveler = InputBox("Please enter the traveler number " & _
"you would like to assign to the machine.", "Assign:")
If strtraveler <> "" Then
Sheets("Machine 2 Schedule").Unprotect "gxs"
'Clears out job from "Not Yet Assigned To Machine" schedule and places
'it on Machine #2 - (Aerospace Jobs) schedule
Do Until rnum = 300
If Cells(rnum, 4) = strtraveler Then
If Cells(16, 3).Value > "" Then
MsgBox "Only 4 jobs can be assigned to a machine at once.", vbExclamation, "Error.."
Exit Sub
End If
Cells(rnum, 3).Copy
Call assignjobnumber
Cells(rnum, 4).Copy
Call assigntravelernumber
Cells(rnum, 5).Copy
Call assignassemblynumber
Cells(rnum, 6).Copy
Call assignquantity
Cells(rnum, 7).Copy
Call assigntimein
Cells(rnum, 8).Copy
Call assignduedate
Range((Cells(rnum, 2)), (Cells(rnum, 8))).Select
Selection.Delete shift:=xlUp
Call priority
Call formatmachinejobs
ElseIf Cells(rnum, 4) <> strtraveler Then
rnum = rnum + 1
End If
Loop
End If
'call lockdown
ThisWorkbook.Save
End Sub
Any help would be great, thanks.