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
| '***********************************************************************
'MISE A JOUR DES DONNEES HORS BORDEREAU
'***********************************************************************
Dim Ele As Range
Dim rTemp As Range
For Each Ele In Range("G221:G250") ' // On fait la recherche sur la quantité ou bien sur plusieurs plages (non testé) Application.Union(Range("G220:G221"), Range("G221:G250"))
If Ele.Value > 0 Then
If Not rTemp Is Nothing Then
Set rTemp = Application.Union(rTemp, Ele.Offset(0, -6).Resize(, 9))
Else
Set rTemp = Ele.Offset(0, -6).Resize(, 9)
End If
End If
Next
If Not rTemp Is Nothing Then
For Each Ele In rTemp.Areas
With Ele
lngLigneEdit = basTools.TS_GetRowID(Worksheets("Consultations").Range("Tconsult").ListObject, "ID", .Columns(1).Value)
Select Case lngLigneEdit
Case Is = 0
basTools.TS_AddRow Worksheets("Consultations").Range("TConsult"), VBA.Array("ID", .Columns(1).Value, "Désignation", .Columns(2).Value, "Unité", .Columns(6).Value, "Qté", .Columns(7).Value)
Case Is > 0
basTools.TS_EditRow Worksheets("Consultations").Range("Tconsult"), VBA.Array("ID", .Columns(1).Value, "Désignation", .Columns(2).Value, "Unité", .Columns(6).Value, "Qté", .Columns(7).Value), lngLigneEdit
Case -1
MsgBox "Le tableau n'a pas pu être trouvé à l'emplacement indiqué", vbOKOnly Or vbInformation, Application.Name
Case Else
End Select
End With
Next
End If
'***********************************************************************
'FIN DE MISE A JOUR DES DONNEES HORS BORDEREAU
'*********************************************************************** |