ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 6,159
- Office Version
- 2024
- Platform
- Windows
The code in use is shown below.
Currently the code works when a user double clicks a cell in column B
If the user double clicks in any other column they are shown a message advising to double click in column B
Currently the next step is that the value in column C is HONDA & if it is the code continues to run.
It is now that if that value is anything other than HONDA then a message needs to pop up with a question, currently its YOU CAN ONLY SELECT HONDA MOTORSYSLES, so this needs to be changed.
The question would basically be CONTINUE TO LOAD USER FORM or JUST STOP
Just stop WOULD EXIT SUB lets say user incorrectly selected wrong column.
Continue WOULD BYPASS THE CODE THAT copies value to MCVIN page & just go straight to opening the user form MotorcycleDatabase.LoadData Me, Target.Row
Basically if the value is YAMAHA or TRIUMPH etc there is no need to copy value to MCVIN sheet BUT still allow the user to see THE OTHER VALUES on user form to be loaded.
Currently the code works when a user double clicks a cell in column B
If the user double clicks in any other column they are shown a message advising to double click in column B
Currently the next step is that the value in column C is HONDA & if it is the code continues to run.
It is now that if that value is anything other than HONDA then a message needs to pop up with a question, currently its YOU CAN ONLY SELECT HONDA MOTORSYSLES, so this needs to be changed.
The question would basically be CONTINUE TO LOAD USER FORM or JUST STOP
Just stop WOULD EXIT SUB lets say user incorrectly selected wrong column.
Continue WOULD BYPASS THE CODE THAT copies value to MCVIN page & just go straight to opening the user form MotorcycleDatabase.LoadData Me, Target.Row
Basically if the value is YAMAHA or TRIUMPH etc there is no need to copy value to MCVIN sheet BUT still allow the user to see THE OTHER VALUES on user form to be loaded.
Rich (BB code):
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 2 Then
If Target.Offset(, 1) = "HONDA" Then
Sheets("MCVIN").Range("F7").Value = ActiveCell.Value
Else
MsgBox "YOU CAN ONLY SELECT HONDA MOTORCYCLES", vbCritical, "HONDA ONLY MESSAGE"
Exit Sub
End If
Else
MsgBox "YOU MUST SELECT THE VIN IN COLUMN B", vbCritical, "SELECT VIN MESSAGE"
Exit Sub
End If
Worksheets("MCVIN").Activate
Worksheets("MCLIST").Activate
MotorcycleDatabase.LoadData Me, Target.Row
End Sub