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
|
'Manager-Resource Association Table
Set myMngrPlage = Range("ManagersRess") ' use the table Ress-Managers as a Range
nLin = myMngrPlage.Rows.Count
nCol = myMngrPlage.Columns.Count
'loop on the cells in Resources plage
'lookup first for the Res-Manager association table
ThisWorkbook.Sheets(shAssoc).Activate
iloop = 1
For Each resCell In mySourcePlage
Debug.Print resCell.Value
If IsError(returnValue = Application.WorksheetFunction.VLookup(resCell, myMngrPlage, 3, False)) Then
MsgBox "Error On VLookup"
'Err.Clear
If Err.Number <> 0 Then
Msg = "L'erreur # " & Str(Err.Number) & " a été générée par " _
& Err.source & Chr(13) & Err.Description
MsgBox Msg, , "Erreur", Err.HelpFile, Err.HelpContext
End If
Exit Sub
End If
'put the vlookup positive search in the right cell in the Manager Column
iloop = iloop + 1
Debug.Print "Lastline in the loop = " & iloop
Next |
Partager