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!
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!