Solved

ComboBox Excel 2003 Get value

Posted on 2010-08-29
5
694 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
  • 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 500 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

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…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

777 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