combobox in exel

Microsoft Office 2007 home and student
May 2, 2011 at 11:02:46
Specs: Windows XP
I have a combobox with two rows ,i would like to put the value of the first row in the active cell
then offset the avtive cell and now put the data of the second row in the now active cell.
The code i have listed works for the first row and it changes the active cell but i cannot paste the data from the second row of the combobox.
Please help me for my knowledge in this matter is limited.

Private Sub ComboBox2_Change()
On Error GoTo ErrHnd

'disable events
Application.EnableEvents = False
'test if combo box selection is not the row 1 message

If ComboBox2.Value <> Worksheets("Numcharge").Range("A1").Value Then
'put first four characters of selected line in active cell
ActiveCell.Value = Left(ComboBox2.Text, 8)
'change active cell
ActiveCell.Cells(, 15).Select
'insert code for value in the second list of the combobox

End If

'move focus off combo box
'set combo box to the row 1 message
ComboBox2.ListIndex = 0
're-enable events
Application.EnableEvents = True
Exit Sub
'error handler
MsgBox "Error"
're-enable events
Application.EnableEvents = True

End Sub

See More: combobox in exel

Report •

May 2, 2011 at 12:17:10
Please provide more detail on "combobox" -- have not used this before.

Report •

May 3, 2011 at 04:41:25
Combobox with drop down list in exel Vba that use the information from a another worksheet, the information in the combobx comes from two different rows.
ex: first row is the name and second row occupation with is displaded in the drop down list of the combobox
Paul Waiter
Dany Cook
Paula Waiteress
John Dishwasher

Now i want this information to be inserted in two different location(cells) on the pay sheet when i click on the information in the drop down list of the combobox.

Report •

Related Solutions

Ask Question