Mikeymike_W
Board Regular
- Joined
- Feb 25, 2016
- Messages
- 171
Hi All,
I have a userform and I want certain textboxes to change their value dependent on the combobox value.
The combobox can show 1st - 4th and I want two text boxes within the userfor to base their values on different cells within my spreadsheet. At the moment I have this, but it doesn't work:
Private Sub CBPrototypes_Change()
If CBPrototypes = "1st" Then
frmcaseaccepted.TBPlanner = Cells(Target.Row, 76)
frmcaseaccepted.CBEngineers = Cells(Target.Row, 81)
End If
If CBPrototypes = "2nd" Then
frmcaseaccepted.TBPlanner = Cells(Target.Row, 82)
frmcaseaccepted.CBEngineers = Cells(Target.Row, 86)
End If
If CBPrototypes = "3rd" Then
frmcaseaccepted.TBPlanner = Cells(Target.Row, 87)
frmcaseaccepted.CBEngineers = Cells(Target.Row, 91)
End If
If CBPrototypes = "4th" Then
frmcaseaccepted.TBPlanner = Cells(Target.Row, 92)
frmcaseaccepted.CBEngineers = Cells(Target.Row, 96)
End If
End Sub
The userform is opened by right clicking on the row.
Hope I've supplied enough information.
Thanks in advance,
Mike
I have a userform and I want certain textboxes to change their value dependent on the combobox value.
The combobox can show 1st - 4th and I want two text boxes within the userfor to base their values on different cells within my spreadsheet. At the moment I have this, but it doesn't work:
Private Sub CBPrototypes_Change()
If CBPrototypes = "1st" Then
frmcaseaccepted.TBPlanner = Cells(Target.Row, 76)
frmcaseaccepted.CBEngineers = Cells(Target.Row, 81)
End If
If CBPrototypes = "2nd" Then
frmcaseaccepted.TBPlanner = Cells(Target.Row, 82)
frmcaseaccepted.CBEngineers = Cells(Target.Row, 86)
End If
If CBPrototypes = "3rd" Then
frmcaseaccepted.TBPlanner = Cells(Target.Row, 87)
frmcaseaccepted.CBEngineers = Cells(Target.Row, 91)
End If
If CBPrototypes = "4th" Then
frmcaseaccepted.TBPlanner = Cells(Target.Row, 92)
frmcaseaccepted.CBEngineers = Cells(Target.Row, 96)
End If
End Sub
The userform is opened by right clicking on the row.
Hope I've supplied enough information.
Thanks in advance,
Mike