1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
Public Function Budget(celluleSite As Range, celluleTaille As Range, celluleNbImp As Range)
Dim sSite As String
Dim sTaille As String
Dim nNbImp As Integer
Dim refTarifs As Range
Set refTarifs = ActiveWorkbook.Worksheets(4).Range("A4:H500")
sSite = celluleSite.Text
sTaille = celluleTaille.Text
nNbImp = Val(celluleNbImp.Text)
Dim nTarif As Integer
Budget = 0
Select Case sTaille
Case "---", "0x0", "1x1"
nTarif = 0
Case "468x60"
nTarif = Application.WorksheetFunction.RECHERCHEV(celluleSite, refTarifs, 2, False)
Case "728x90"
nTarif = Application.WorksheetFunction.RECHERCHEV(celluleSite, refTarifs, 3, False)
Case "120x600"
nTarif = Application.WorksheetFunction.RECHERCHEV(celluleSite, refTarifs, 4, False)
Case "160x600"
nTarif = Application.WorksheetFunction.RECHERCHEV(celluleSite, refTarifs, 5, False)
Case "300x250"
nTarif = Application.WorksheetFunction.RECHERCHEV(celluleSite, refTarifs, 6, False)
Case "250x250"
nTarif = Application.WorksheetFunction.RECHERCHEV(celluleSite, refTarifs, 7, False)
Case Else
nTarif = 0
End Select
Budget = nTarif * nNbImp / 1000
End Function |
Partager