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 40 41 42 43 44 45 46 47 48 49 50 51 52
|
Function traitementsGen(ByRef tableau As Variant) As Boolean
Dim i As Integer
Dim nbPers As Integer
Dim dDate As Date
Dim dDate2 As Date
Dim lDate As Long
Dim lDate2 As Long
dDate = DateSerial(2011, 1, 1)
dDate2 = DateSerial(2011, 12, 31)
lDate = dDate
lDate2 = dDate2
Workbooks.Open Filename:="Z:\Desktop\SUIVI D'ACTIVITE INJECTION\Tableau Panel ID à remplir TB.xls"
ActiveWindow.Visible = True
'lecture de la colonne
Range("D4:D250").Select
'Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.AutoFilter Field:=2, Criteria1:=">=" & lDate, Operator:=xlAnd _
, Criteria2:="<=" & lDate2
Dim rTbl
Dim iHdrRows
Set rTbl = Range("D4").CurrentRegion
iHdrRows = rTbl.ListHeaderRows
iHdrRows = 3
'rTbl.EntireColumn.SpecialCells(xlCellTypeVisible).Select
Set rTbl = rTbl.Resize(rTbl.Rows.Count - iHdrRows, 4).Offset(iHdrRows)
rTbl.SpecialCells(xlCellTypeVisible).Select
Debug.Print Selection.Address
'nbPers = Count_Selected_Cells(Selection, "NOM1")
'Debug.Print "NOM1" & " => " & nbPers
'For i = LBound(tableau) To UBound(tableau)
'nbPers = Count_Selected_Cells(Selection, tableau(i))
'Debug.Print tableau(i) & " => " & nbPers
'Next i
ActiveWindow.Close (False)
End Function |
Partager