Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I inject VBA into Excel?

Posted on 2011-09-06
12
Medium Priority
?
470 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
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
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.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

927 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