tags:

views:

15

answers:

1

I have an invoice spreadsheet with comboboxes to select a product which fills out the product number and name in the invoice. Then I have a clear button that clears the information out to do another invoice, but the combo box and the linked cells don't get cleared. I tried adding the code ComboBox2.Clear or ComboBox2.Value="", or DropDown2.Clear, but I keep getting a run-time 424 error object required. What am I doing wrong.

Sub ClearIncoive()
ClearIncoive Macro
'Clear the invoice
Range("G6:G9,F16,G16:H16,F17,G17:H17,F18:H28").Select
Range("F18").Activate
Selection.ClearContents
ComboBox2.Clear
End Sub

Any help?

A: 

I played around with a few things and got the same error you did, so I figured I was on the right track. The combobox I created, with Excel 2010, was a Form Control. I then created another combobox using the ActiveX Control and used

Sheets(1).ComboBox2.Value = ""

Note that I set the contents of the combobox to A1:A8, which contained the data for the combobox.

Edward Leno
Thank very much that worked. I also found this code Sheets("Sheet1").Range("M16").Value = 1050where the row 1050 = a blank record. Thank you very much!
Lars
Excellent, glad you are on your way.
Edward Leno