Hi all i`v been loitering around here for a while and made a few nice time saving programs in excel but this is my first post.
I'm trying to turn a flow chart of questions and answers in to in to a program in excel that will ask our customers how they will use a vehicle to help them select the correct options when ordering. I have commented out the route the code will take if they answer yes to the first question and the same for no, and both parts of the code work on their own. However when both parts of the code are un-commented i cant get a response to a no answer on the first question. Im sure this is a simple answer that i just cant see, i have been on it for hours and crawled all over google but i just cant get it working, i have been playing with else if and elseif to see if that makes a difference, end if, end sub...im lost can anyone out there tell me where im going wrong please?
(to run this code the user must click an image of a manufacturer logo which opens a userform showing images of different vehicles, clicking the image will run the code below)
Private Sub Image6_Click()
Dim Answer1 As Integer
Dim Answer2 As Integer
Dim Answer3 As Integer
Dim Answer4 As Integer
Dim Answer5 As Integer
Answer1 = MsgBox("Is the vehicles load more than 5mA at engine off (overnight with no means of isolation) e.g. Tracker or CCTV?", vbYesNo + vbQuestion, "BEMM Tool")
If Answer1 = vbYes Then
Answer2 = MsgBox("Will large electrical loads be drawn from the system (40A-250A)e.g. Tipper, tail lifts, welfare van, inverters greater than 480W, microwaves, powertools?", vbYesNo + vbQuestion, "BEMM Tool")
If Answer2 = vbYes Then
MsgBox "Your vehicle will require the twin AGM battery upgrade, and the upgraded 210A alternator ordering from the factory (number:HFL & A736)"
Exit Sub
Else
If Answer2 = vbNo Then
Answer5 = MsgBox("will the system draw loads greater than 30A at engine run e.g. command vehicle, maintenence vehicle, inverter <360W-480W, water boiler, small power tools", vbYesNo + vbQuestion, "BEMM Tool")
If Answer5 = vbYes Then
MsgBox "your vehicle will need to be ordered with the twin AGM battery upgrade and standard 150A alternator (order number: a736)"
Exit Sub
Else
If Answer5 = vbNo Then
MsgBox "your vehicle will need to be ordered from ford with the twin AGM battery upgrade and standard 150A alternator (order number: a736)"
Exit Sub
Else
If Answer1 = vbNo Then
Answer3 = MsgBox("will you frequently draw loads less than 30A at engine run,eg. service engineers van, worklamps,ambers,handwash?", vbYesNo + vbQuestion, "BEMM Tool")
If Answer3 = vbYes Then
MsgBox "your veichle will need to be ordered with twin flooded batteries and the standard 150A alternator(order number:NXL)"
Exit Sub
Else
If Answer3 = vbNo Then
Answer4 = MsgBox(" will your vehicle ocasionaly be drawing loads of less than 30A at engine run,e.g. courier van, charging gps/phone, interior lights, small 12v kettle?", vbYesNo + vbQuestion, "BEMM Tool")
If Answer4 = vbYes Then
MsgBox "your vehicle will require standard single flooded battery and standard 150a alternator and will not requre factory fit upgrades"
Exit Sub
Else
If Answer4 = vbNo Then
MsgBox "your vehicle will require standard single flooded battery and standard 150a alternator and will not requre factory fit upgrades"
Exit Sub
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
Aucun commentaire:
Enregistrer un commentaire