Solved

Cell Value Equal Combo Box in Excel

Posted on 2013-06-25
5
5,885 Views
Last Modified: 2013-06-25
Hi,

I have goolged this and seen there are several ways to accomplish this, but I can 't seem to make it work. Not sure if I use VBA or just have the cell value equal the combo box contents.

In my Print Report! worksheet I am using a bunch of vlookups from my DataEntry! worksheet. All of these lookups are currently based off the cell in PrintReport! E3 and they work just fine. But, I would like to use the combo box properties of autocomplete (there will be about 600 entries by the end of the year) to make it easier picking the name. I created a combo box (activeX) and set the properties. I am using quite a bit of Index, Match and vlookups throughout the entire workbook. I have done this all on my own, so I am certain there are better ways, but this is what I know how to do.

Question: How to I set the value in E3 (PrintReport!) to the contents of my combo box?  The combo box will be moved over E3, so the user will only see the combo box.

My workflow will be entering the data into DataEntry! worksheet, then choose from the combo box which will populate the results. Then they will click on EMAIL REPORT which will save as a PDF and email the report (Ok, still working on that part :)  )

Thanks for any help!
EE-Question.xlsx
0
Comment
Question by:bvanscoy678
  • 3
  • 2
5 Comments
 
LVL 12

Accepted Solution

by:
telyni19 earned 500 total points
Comment Utility
I think the simplest way is to just use the Change event on the combobox. Open the code for the combobox (enter design mode, right-click on the combobox, and choose "View Code"). Replace any existing Change event with the following:

Private Sub TempCombo_Change()
ActiveSheet.Range("E3").Value = TempCombo.Value
End Sub

Open in new window

0
 

Author Comment

by:bvanscoy678
Comment Utility
Yes, that did the trick! Thanks for the help
thanks
0
 

Author Closing Comment

by:bvanscoy678
Comment Utility
Thank you. Brente
0
 
LVL 12

Expert Comment

by:telyni19
Comment Utility
(Answering the question about defining the tempcombo variable:) Nope. tempcombo appears to be the name of your combo box already. If you're within the tempcombo_Change event, the context of the code ensures that the reference to tempcombo will be understood. You can even use Me.Value instead, as the keyword Me will refer to whatever object owns the current event. But I tested what I gave you in the file you attached, so if you paste in exactly what I gave you, you should get the desired results.
0
 

Author Comment

by:bvanscoy678
Comment Utility
I must have done something wrong the first time, then I posted the reply. Once I tested again, it worked just fine. I wasn't exactly sure where the tempcombo_Change event was located, but after a quick read, I can see that the drop down arrow in the upper right corner was set to change.

Great information about me.value. I will keep that in mind.

Thanks! Brent
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now