Solved

How do I inject VBA into Excel?

Posted on 2011-09-06
12
451 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:newbieweb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 47

Accepted Solution

by:
Martin Liss earned 200 total points
ID: 36491863
Click the little 'Visual basic editor' button that you'll find to the right of the 'Securiy…' menu item.
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 36491869
After that it's pretty much like VB6 if you're familiar with it.
0
 

Author Comment

by:newbieweb
ID: 36491902
Sorry, I forgot to say Excel 2007. And what tab do I select?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:newbieweb
ID: 36491912
Is it the View Code button?
0
 

Author Comment

by:newbieweb
ID: 36491934
If so, please explain the various Microsoft Excel Object...
0
 
LVL 81

Assisted Solution

by:byundt
byundt earned 150 total points
ID: 36491936
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
 
LVL 24

Assisted Solution

by:StephenJR
StephenJR earned 150 total points
ID: 36491949
For an ActiveX control, yes. Is it in the sheet or on a form?
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 36491962
0
 

Author Comment

by:newbieweb
ID: 36491976
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
 

Author Comment

by:newbieweb
ID: 36492059
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
 

Author Comment

by:newbieweb
ID: 36492075
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
 

Author Closing Comment

by:newbieweb
ID: 36496421
Thanks.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question