28/06/2005, 23h07
|
#6 (permalink)
|
|
XLDnaute Barbatruc
Date d'inscription: février 2005
Messages: 3 814
|
Re:Imprimer mon USF
bonsoir Sébastien
tu peux tester cette adaptation
Function LineTracer(ByVal Mat As String) As Long
Dim DerCellA As Long, i As Long
Dim C As Byte, y As Byte
x = 2
Me.Spreadsheet1.Cells.ClearContents
TextBox2.Value = ''
TextBox3.Value = ''
For y = 1 To 8
Me.Spreadsheet1.Cells(1, y).Value = CStr(Cells(1, y))
Next y
With Sheets('Feuil1')
DerCellA = .Range('A65536').End(xlUp).Row
On Error Resume Next
Cible = Application.Match(Mat, Sheets('Feuil1').Range('A2:A' & DerCellA), 0)
If Cible = 0 Then
MsgBox 'matricule inexistant'
Exit Function
End If
On Error GoTo 0
For i = 2 To DerCellA
If Mat = .Cells(i, 1) Then
Me.Spreadsheet1.Cells(x, 1) = CStr(.Cells(i, 1))
Me.Spreadsheet1.Cells(x, 2) = CStr(.Cells(i, 2))
Me.Spreadsheet1.Cells(x, 3) = CStr(.Cells(i, 3))
Me.Spreadsheet1.Cells(x, 4) = CStr(.Cells(i, 4))
Me.Spreadsheet1.Cells(x, 5) = CDate(.Cells(i, 5))
Me.Spreadsheet1.Cells(x, 6) = CDate(.Cells(i, 6))
Me.Spreadsheet1.Cells(x, 7) = CStr(.Cells(i, 7))
Me.Spreadsheet1.Cells(x, 8) = CDate(.Cells(i, 8))
x = x + 1
LineTracer = i
End If
Next
End With
End Function
bonne soiree
MichelXld
|
|
|