ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help a newbie in a ComboBox fix..... (https://www.excelbanter.com/excel-discussion-misc-queries/34436-help-newbie-combobox-fix.html)

rosemary

Help a newbie in a ComboBox fix.....
 

Hi,

I'm experiencing some difficulty with the ComboBox macro. It works
correctly when I put it into the document (saving the document poses no
problems). After I close the program and then reopen it, I have to go
into each and every combobox and run it again! How can I avoid having
to do this each time?

Thanks,
Rosemary


--
rosemary
------------------------------------------------------------------------
rosemary's Profile: http://www.excelforum.com/member.php...o&userid=25042
View this thread: http://www.excelforum.com/showthread...hreadid=385659


bhofsetz


Rosemary,
Post your code, or an example of the code you are using for the
combo boxes and we will be able to help you better.


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=385659


rosemary


Private Sub ComboBox1_Change()
ComboBox1.List = Array("1", "2", "3", "4", "5+")
End Sub



Thanks!


--
rosemary
------------------------------------------------------------------------
rosemary's Profile: http://www.excelforum.com/member.php...o&userid=25042
View this thread: http://www.excelforum.com/showthread...hreadid=385659


bhofsetz


Put your fill code in a combobox get focus event handler rather than a
combobox change event handler and that should do the trick

Private Sub ComboBox1_GotFocus()
ComboBox1.List = Array("1", "2", "3", "4", "5+")
End Sub

HTH


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=385659


rosemary


Thank you so much! That did the trick. (Thanks for being patient with
a complete newbie, too.)

Rosemary


--
rosemary
------------------------------------------------------------------------
rosemary's Profile: http://www.excelforum.com/member.php...o&userid=25042
View this thread: http://www.excelforum.com/showthread...hreadid=385659


bhofsetz


You are welcome Rosemary, glad it helped. We all have to start
somewhere. :cool:

Brendon


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=385659



All times are GMT +1. The time now is 02:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com