LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Macro for Control ListBox

Hi,

I have a List Box that I created from the Control Toolbox -- I am trying to
have a macro run based off of which value has been selected in the listbox
(there are only two values that can be selected). I tried the code below,
but am getting the following error: "Run-time error 438: Object doesn't
support this property or method".

If ActiveSheet.Object("ListBox1").Value = "Equivalent kwh/yr" Then
Call Module4.togglequiv
Else
If ActiveSheet.Object("ListBox1").Value = "Actual kwh/yr" Then
Call Module4.toggleact
End If
End If

Can someone let me know what the proper coding should be? Thanks for your
help!!

Robert
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveX Listbox Control TrendyProgrammer Excel Programming 1 August 2nd 05 08:37 PM
Help with listbox control events TrendyProgrammer Excel Programming 3 July 11th 05 06:07 PM
Control of Listbox Colors Nigel[_6_] Excel Programming 0 February 21st 04 08:46 AM
Listbox control Robert Couchman[_4_] Excel Programming 1 February 11th 04 09:58 AM
listbox control in VBA Ard Excel Programming 1 January 28th 04 05:53 PM


All times are GMT +1. The time now is 04:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"