[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ComboBox Excel 2003 Get value

Posted on 2010-08-29
5
Medium Priority
?
700 Views
Last Modified: 2012-06-22
Hi All,

Having a hard time with what I thought was easy.

I have a visual basic script in Excel 2003.  I have a combobx named "ComboBox1".  How do i print out the current value in combobox???

I have tried just
MsgBox (ComboBox1.Value)

to print out the value and this does not work.
0
Comment
Question by:sporenza
[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
  • 3
  • 2
5 Comments
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 33552613
Have you tried .Text?
Private Sub Combo1_Click()
  Debug.Print Combo1.Text
End Sub

Open in new window

0
 

Author Comment

by:sporenza
ID: 33553506
Hi eql1044,

If I run _ClicK(), nothing happens when I change the drop down.

If I run:
Private Sub ComboBox1_Change()
  Debug.Print Combo1.Text
End Sub


I get Run-time error '424'

Thnaks!
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 33553523
Did you try with the name of your ComboBox object?
Msgbox ComboBox1.Text

Open in new window

0
 

Author Comment

by:sporenza
ID: 33553571
This worked!!!

How do I set this to a varriable??

I want something like, if possible:

   Dim filename As String
   filename = ComboBox1.Text
0
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 2000 total points
ID: 33553578
You have already answered this in your own example above ^^  :)
Dim filename As String
filename = ComboBox1.Text

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

649 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