Excel VBA - Clear Userform Problem

  • Thread starter Thread starter thesteelmaker
  • Start date Start date
T

thesteelmaker

I have created a form that adds data to a row in a spreadsheet. Once th
details are added to textbox's and selected using combo box', the use
presses an add details button.

When the button is pressed the details are entered fine, but i want t
clear the textbox's and combo box'.

I am using txtbox1.value = "" to clear the text box's ok

but i can't seem to clear the combo box's.

I have used:

cboDetails.Clear, this just clears the whole list.
cboDetails.Value = "", this brings up an error as i have se
MatchRequired.

I even added
.AddItem "", to the combos list but cboDetails.Value = "" still bring
up an error.

All i want is a blank combo box after the details are entered.

I cant re initialize the form as some of the boxs i don't wan
cleared.

Any ideas.
Many Thank
 
Haven't tried this myself, but try using a string with a few blanks like " ", instead of "".
 
After reading again

You must only clear one item in the list?

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




Ron de Bruin said:
You can use

ComboBox1.Clear
 
Hi

Use
cboDetails.Listindex = -1
to remove the selection and still keep its list intact.

HTH. Best wishes Harald
 
Oops I forgot to paste the line

Try

ComboBox1.Value = ""

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




Ron de Bruin said:
After reading again

You must only clear one item in the list?
 
Don't read this stupid answer because I don't read yours also<g>

See Harald's answer

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




Ron de Bruin said:
After reading again

You must only clear one item in the list?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top