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: 61
Default return 2 or more variables from a function

I just can remember how to do the following.

I need to return 2 variables from a function so that I can use them within a
sub.
In this case 2 column numbers so that I can use them to find something.

Any help would be appreciated

regards
David

-----------
Sub Find_Columns
Dim Col1, col2 as integer

Col1 = YColumn(check)

End sub


Function YColumn(check As String)

Select Case check

Case "Vegetables"
Col1 = 2
Col2 =4

Case "Mellons"
Col1 =5
Col2 = 6

End Select

End function


 
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
Multiple variables to sort and sum, return values<0 with sum refer Stinky Excel Worksheet Functions 5 April 20th 10 04:18 PM
Lookup function for two variables and return another cell? dcw0405 Excel Worksheet Functions 2 February 4th 10 05:23 PM
using =IF function with 12 variables swell estimator[_2_] Excel Discussion (Misc queries) 4 September 8th 08 12:09 AM
Lookup based on two variables and return a third Mark Excel Worksheet Functions 3 August 29th 08 03:26 PM
2 Conditions True, Many Variables, Return Result elliekev26 Excel Worksheet Functions 4 September 22nd 05 04:16 PM


All times are GMT +1. The time now is 05:22 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"