Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I inject VBA into Excel?

Posted on 2011-09-06
12
Medium Priority
?
464 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 49

Accepted Solution

by:
Martin Liss earned 800 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 49

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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 600 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 600 total points
ID: 36491949
For an ActiveX control, yes. Is it in the sheet or on a form?
0
 
LVL 49

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

722 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