View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Mohamed Elamrani Mohamed Elamrani is offline
external usenet poster
 
Posts: 6
Default Application.Match problem

this is my master code ( the first one it was just little one to explain my problem)
in this code the problem persist I don't know why
thank you for your valuable help


Public Sub vol()
With Sheets("F. Regulation")
Dim min, INTL As Long
Dim dt As Double
min = 3000


For INTL = 0 To 20
If CLng(Sheets("Standard d'engagement").Cells(3 + INTL, 4)) < min And Sheets("Standard d'engagement").Cells(3 + INTL, 4) < "" Then
min = CLng(Sheets("Standard d'engagement").Cells(3 + INTL, 4))
i = INTL
End If
Next

dt = CDbl(Sheets("Standard d'engagement").Cells(3 + i, 4))
'Cells(3, WorksheetFunction.Match(Cells(3 + i, 4), Range("B2:EP2"), 0)) = X

For j = 0 To 18
If Cells(j + 3, Application.Match(dt, Range("B2:EP2"), 1)) = "" Then

For i = i To i + 13
Cells(j + 3, Application.Match(CDbl(Sheets("Standard d'engagement").Cells(3 + i, 4)), Range("B2:EP2"), 1)) = X
Next
End If
Next

Sheets("Standard d'engagement").Cells(3 + i, 4).ClearContents
End With
End Sub