Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi all I am trying to get a func

Status
Not open for further replies.

AnnaWnz

MIS
Dec 10, 2002
22
NZ
Hi all

I am trying to get a function to return a value for a cell based on two variables...

In basic language, the cell that needs the value is in column "L". In the following example I refer to Row 2.

Find the value of cell A2 in the data range (which is in another worksheet), and then find the value of cell C2 in the data range, where the value of A2 has already been found. The value of L2 is then the value of column H in the data range, from the row on which both the value of cells A2 and C2 were found.

I had this running when using a sequential file, using

Do While (Not FoundFlag) or EOF(1)
Input #1, Code1, BusinessUnit, ForecastType, Mth, Cust, Code2, Code3, Qty, MthRef
If (Code2 = ItemCode) Then
If (Mth = MonthRef) Then
FGetQty = Qty
FoundFlag = True
End If
End If
Loop

Where ItemCode is the value held in A2, and Mth is the value held in C2.

I can't use the sequential file option as the informaiton needs to be available to the spreadsheet when the sequential file is no longer available (ie on and off a network), so have imported the data into a worksheet.

Thanks in advance for any help!
 
Hi,

OK - but what can't you do or get? What is your problem?

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top