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: 78
Default vlook up Function

Hi K****ij,

I think that is not a standard function availeble for your problem,
In Excel2003 I have created 2 functions for you:


Public Function K****ijStart(AnIndex As String, _
AllData As Range, _
CodeStart As String) As String
On Local Error GoTo K****ijStart_err

Dim intLoop As Integer

For intLoop = 1 To AllData.Rows.Count
If AllData.Cells(intLoop, 1).Value = AnIndex Then
If Left(AllData.Cells(intLoop, 5).Value, 1) _
= CodeStart Then
K****ijStart _
= Mid(AllData.Cells(intLoop, 5), 3, 8)
Exit For
End If
End If
Next

GoTo K****ijStart_exit

K****ijStart_err:
K****ijStart = "Error"

K****ijStart_exit:
End Function

Public Function K****ijEnd(AnIndex As String, _
AllData As Range, _
CodeStart As String) As String
On Local Error GoTo K****ijEnd_err

Dim intLoop As Integer

For intLoop = 1 To AllData.Rows.Count
If AllData.Cells(intLoop, 1).Value = AnIndex Then
If Left(AllData.Cells(intLoop, 5).Value, 1) _
= CodeStart Then
K****ijEnd = _
Right(AllData.Cells(intLoop, 5).Value, 8)
Exit For
End If
End If
Next

GoTo K****ijEnd_exit

K****ijEnd_err:
K****ijEnd = "Error"

K****ijEnd_exit:
End Function

The first will give the start date the second the end date of the
period.

Both expect 3 parameters:

1) The indexno. to look for
2) The data range to look in
3) A letter "E" or "G"

Sample for cell B2 on Sheet2:
=K****itijStartDate(A2;Sheet1!$A$2:$E$5;"E")

Sample for celll C3 on Sheet3:
=K****ijEnd(A3;Sheet1!$A$2:$E$5;"G")


HTH,

Wouter
 
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
VLOOK-pivot table expanding want to update vlook automatically CrimsonPlague29 Excel Worksheet Functions 0 August 8th 07 09:44 PM
VLOOK-pivot table expanding want to update vlook automatically CrimsonPlague29 Excel Worksheet Functions 0 August 8th 07 09:44 PM
use vlook up function Kam Excel Programming 1 February 21st 07 11:58 PM
Vlook Up Function potsie via OfficeKB.com Excel Discussion (Misc queries) 1 April 24th 06 03:58 AM
If Function containing VLook up Michele Excel Worksheet Functions 5 December 6th 05 09:09 PM


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