98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » COMBO BOX - SHOW FIRST LINE
COMBO BOX - SHOW FIRST LINE
Resolved · Low Priority · Version 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 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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Removing border lines on the keyboardHighlight your cell(s) that have boreders on them and press CTRL + SHIFT + _, this will then remove the border lines. |