Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

combo box show

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » COMBO BOX - SHOW FIRST LINE

COMBO BOX - SHOW FIRST LINE

ResolvedVersion 2003

Tony has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course
Access Intermediate course
Access Advanced course

COMBO BOX - SHOW FIRST LINE

I have a form to enter a new row of data to spreadsheet using combo boxes. For many of the cells, it is possible that the new value is the same as the previous row. I add the previous value to the combobox as an option. Ideally I would like this to be visible rather than having to press the drop down arrow. If nothing has changed, I would like that value to be the defalt value taken when the form is closed and the next line to data added to the spreadsheet. If only one value is diferent on the form this would reduce the number of slections required to create the new record. I know this sounds like it would be better in a database, but there are a lot of calculations happening in other areas of the speadsheet.

Thanks

Tony

RE: COMBO BOX - SHOW FIRST LINE

Hi Tony, thanks for your query. You need to set the ComboBox.text value to be equal to the current value in the relevant cell in the row that is already in there. Something like...

ComboBox1.text = Sheets("My Spreadsheet").Range("A2").Value

You could hard could these one by one, but it would be far more elegant to do it with a loop. However, these method should populate the ComboBox default values with the values of the cells already on the sheet.

Hope this helps,

Anthony

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Display pictures on Chart Data Point

Replacing a single chart data point bar with a picture.
Step 1: Left click on a bar. Then, wait, and do a second single click on the bar. This will select just one data point.

Step 2: Right click on the bar and select Format Data Point.

Step 3: On the fill effects tab, choose a picture. Browse for a picture for that bar. Indicate if you want it to be stretched or stacked. Repeat for each bar.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.