Solved

ComboBox Excel 2003 Get value

Posted on 2010-08-29
5
697 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 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
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 Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

730 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