How do I inject VBA into Excel?

I need to use existing code that populates a combo box in Excel, but am not sure where or how to add the code.

Can anyone tell me?

Thanks.
newbiewebSr. Software EngineerAsked:
Who is Participating?
 
Martin LissConnect With a Mentor Older than dirtCommented:
Click the little 'Visual basic editor' button that you'll find to the right of the 'Securiy…' menu item.
0
 
Martin LissOlder than dirtCommented:
After that it's pretty much like VB6 if you're familiar with it.
0
 
newbiewebSr. Software EngineerAuthor Commented:
Sorry, I forgot to say Excel 2007. And what tab do I select?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
newbiewebSr. Software EngineerAuthor Commented:
Is it the View Code button?
0
 
newbiewebSr. Software EngineerAuthor Commented:
If so, please explain the various Microsoft Excel Object...
0
 
byundtConnect With a Mentor Commented:
If you are using a Forms toolbar combobox, the code goes in a regular module. Use the Insert...Module menu item in the VBA Editor to create a regular module sheet if you don't have one.

If you are using an Active-X combobox, the code goes in the code pane for the worksheet. Right-click the sheet tab and choose View Code to expose that code pane.
0
 
StephenJRConnect With a Mentor Commented:
For an ActiveX control, yes. Is it in the sheet or on a form?
0
 
Martin LissOlder than dirtCommented:
0
 
newbiewebSr. Software EngineerAuthor Commented:
I intend to use the VBA in this link:

http://datapigtechnologies.com/blog/index.php/recordset-tricks-in-excel-1-filling-a-combobox-with-unique-values/

to fill the combo from another Excel file. Then I plan to edit it to also read the data from a database.

I am not sure where to put that data.
0
 
newbiewebSr. Software EngineerAuthor Commented:
The link talks about using an Active X control.

> Is it in the sheet or on a form?

It's on the sheet, not a form.

Those tiff's do not look anythin like my Excel, which is 2007. Am I missing something?
0
 
newbiewebSr. Software EngineerAuthor Commented:
BUT, I do not want this any more complicated than necessary. I just want to move the contents of a combo box to outside of the Excel, first to another Excel, then to a database. If you have an easier way, please be my guest.
0
 
newbiewebSr. Software EngineerAuthor Commented:
Thanks.
0
All Courses

From novice to tech pro — start learning today.