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
|
Private Sub NumeroLigne()
Dim ligne As Long
Dim myr As Long
Dim myv As Long
Dim i
Sheets("20 03 2012").Cells.Find("1030", Range("A1"), xlValues, xlWhole).Activate
myv = ActiveCell.Columns(ActiveCell.Columns.Count).Column
Sheets("20 03 2012").Cells.Find("1530", Range("A1"), xlValues, xlWhole).Activate
myr = ActiveCell.Columns(ActiveCell.Columns.Count).Column
Sheets("20 03 2012").Cells.Find("GC1", Range("A1"), xlValues, xlWhole).Activate
ligne = ActiveCell.Row
Range(Cells(ligne, myv), Cells(ligne, myr)).Activate
For i = 1 To 6
If ActiveCell <> "" Then
Sheets("20 03 2012").Cells.FindNext(After:=ActiveCell).Activate
ligne = ActiveCell.Row
Range(Cells(ligne, myv), Cells(ligne, myr)).Activate
Else
Range(Cells(ligne, myv), Cells(ligne, myr)).Merge
ActiveCell = i
Exit For
End If
Next i
End Sub |
Partager