enfantter
09-21-2011, 12:31 AM
Hi all,
I have a 10 by 30 table in excel. The 10 rows are countries and the 30 columns are dates. For each country, every date kan have one of three values, "-","WE" or "C".
What i wanna do is an indicator of when the next day is (that does have the value "-") and im thinking to do with something like a loop. Initially i wanna return the number of days until the next "-".
I have tried something like this,
For i = 1 To 50
If WorksheetFunction.VLookup(country, Sheets("Input").Range("A2:AI84"), settlement + i - 1, False) = "-" Then
Next_settlement_date = 1
Else: Next_settlement_date = WorksheetFunction.VLookup(country, Sheets("Input").Range("A2:AI84"), settlement + 1, False)
End If
Next i
but i guess i am pretty far off.
Does this make any sense or do i need to clearify anything ?
I have a 10 by 30 table in excel. The 10 rows are countries and the 30 columns are dates. For each country, every date kan have one of three values, "-","WE" or "C".
What i wanna do is an indicator of when the next day is (that does have the value "-") and im thinking to do with something like a loop. Initially i wanna return the number of days until the next "-".
I have tried something like this,
For i = 1 To 50
If WorksheetFunction.VLookup(country, Sheets("Input").Range("A2:AI84"), settlement + i - 1, False) = "-" Then
Next_settlement_date = 1
Else: Next_settlement_date = WorksheetFunction.VLookup(country, Sheets("Input").Range("A2:AI84"), settlement + 1, False)
End If
Next i
but i guess i am pretty far off.
Does this make any sense or do i need to clearify anything ?