I have the following code which for some reason is not working and I can't figure it out. If the value = True, then the code runs fine but if the value = False, the MsgBox "Machine already exists. Please select from dropdown." still pops up. For some reason it will not do anything if the value = False. Can someone let me know what is wrong with the code? If you need anything additional, please let me know. Thanks!
Sub GoChange() On Error Resume Next Dim lReply As Long Dim inputWks As Worksheet Dim lRsp As Long If inputWks.Range("MachineName") = True Then MsgBox "Machine already exists. Please select from dropdown." Exit Sub Else If inputWks.Cells("MachineName") = False Then lRsp = MsgBox("Machine not in database. Add to dropdown?", vbQuestion + vbYesNo, "New Machine") If lRsp = vbYes Then Range("MachineList").Cells(Range("MachineList").Rows.Count + 1, 1) = Range("$J$6") Else MsgBox "Please select Machine that is in the database." End If End If End If End Sub