LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Passing a value and getting results

Private Sub Combobox1_Click()
with combobox1.listIndex
case 0
returnNumbers = Array(1,2,3)
case 1
returnNumbers = array(4,5,6)
case else
returnNumbers = array(7,8,9)
End Case
End Sub

In a general module

Public returnNumbers as Variant

Public Sub MyFunc()
Application.Volatile
MyFunc = returnNumbers
End Function

Select A1 to C1
in the formulabar enter
=MyFunc()

end with Ctrl+Shift+Enter




--
Regards,
Tom Ogilvy



"George" wrote in message
...
I need to pass a value from a list box to a worksheet and
get a number of values back to display to a user. I'm
using a listbox for the user to choose the original value.
Does anyone have VB code to help me get started?



 
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
formula for % passing RKing Excel Worksheet Functions 2 August 30th 07 03:32 PM
Passing Variables Jeff Excel Discussion (Misc queries) 1 November 4th 05 06:46 PM
Passing Variables Royce[_2_] Excel Programming 1 November 20th 03 02:16 PM
passing strings Sirron Excel Programming 2 August 27th 03 04:33 PM
PASSING A STRING VALUE Sirron Excel Programming 2 August 26th 03 06:40 PM


All times are GMT +1. The time now is 11:16 AM.

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"