Solved

reference comobobox thru vba in Excel

Posted on 2011-03-04
4
324 Views
Last Modified: 2012-05-11
I am trying to access a combobox value through vba.  However my code is not working.

The code is in a module so I figured I'd have to specify a sheet and I'd be okay.

Sub cboFight1_Change()
    Dim curVal As String
    curVal = ActiveSheet.cboFight1.Value
   
    MsgBox curVal
End Sub

I get an object doesn't support that property or method.

Any ideas,
JOe K.
0
Comment
Question by:ClaudeWalker
[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
  • 2
4 Comments
 
LVL 9

Expert Comment

by:hitsdoshi1
ID: 35040964
curVAL= ActiveSheet.Shapes("cboFight1").Value
0
 

Author Comment

by:ClaudeWalker
ID: 35040996
ActiveSheet.Shapes("cboFight1").Value

still gives me that error
0
 
LVL 9

Accepted Solution

by:
chwong67 earned 500 total points
ID: 35041002
curVal = ActiveSheet.DropDowns(Application.Caller).List(ActiveSheet.DropDowns(Application.Caller).Value)
0
 

Author Comment

by:ClaudeWalker
ID: 35041020
curVal = ActiveSheet.DropDowns(Application.Caller).List(ActiveSheet.DropDowns(Application.Caller).Value)

WORKED!!!!

That seems way overly complicated though.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
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…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

710 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