LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Defined Fuction Returning Range Help


Hi Tim,

Sorry for the late reply.I was out of station .here is my udf


Function GetSalaryRange(strTitle As String) As Range
Dim wsCatLookup As Worksheet
Dim rngTemp, rngSalRng, rngTemp1 As Range
Dim rngVar As Range
Set wsCatLookup = ThisWorkbook.Sheets("CategoryLookup")
Set rngTemp = wsCatLookup.Range("A4:B19")
Set rngSalRng = wsCatLookup.Range("E4:G19")



'rngTemp.Select

strCategory = WorksheetFunction.VLookup(strTitle, rngTemp, 2
True)

Set rngVar = rngSalRng.Find(what:=strCategory,, LookAt:=xlWhole, _
LookIn:=xlValues).Offset(0, 1).Resize(1, 2)



Set GetSalaryRange = rngVar



End Functio

--
xcelio
-----------------------------------------------------------------------
xcelion's Profile: http://www.excelforum.com/member.php...fo&userid=1628
View this thread: http://www.excelforum.com/showthread.php?threadid=31373

 
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
User Defined Function returning #Value! DogLover Excel Worksheet Functions 4 November 25th 09 07:31 PM
User-defined range for graph royend Excel Discussion (Misc queries) 3 September 4th 07 09:11 AM
Passing a range to a user defined function Gary Nelson Excel Discussion (Misc queries) 1 July 19th 07 04:22 PM
User-defined data type; Error: Only User-defined types... tiger_PRM Excel Programming 1 July 18th 04 03:32 PM
external range in VBA (user defined formula) BrianB Excel Programming 2 July 23rd 03 06:25 PM


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