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
|
Sub format_data_m()
Dim y As Integer, x As Integer, cible As Integer
y = 4
Do While Not (IsEmpty(Worksheets(3).Cells(y, 1)))
y = y + 1
Loop
' MsgBox "Est vide : " & y
cible = y + 1
x = 1
y = 1
Do While x <> 18
If Worksheets(3).Cells(cible, x) <> "" And Not (IsEmpty(Worksheets(3).Cells(cible, x))) Then
Worksheets(1).Cells(2, y) = Worksheets(3).Cells(cible, x)
y = y + 1
End If
x = x + 1
Loop
Call copie_ligne(Worksheets(3), cible, Worksheets(2), 2, 18)
End Sub
Public Sub copie_ligne(source As Worksheet, x_source As Integer, destination As Worksheet, x_destination As Integer, stop_col As Integer)
Dim y As Long, z As Long
source.Activate
y = 1
z = 1
Do While y <> stop_col
If (source.Cells(x_source, y) <> "") And (Not (IsEmpty(source.Cells(x_source, y)))) Then
destination.Cells(x_destination, z) = source.Cells(x_source, y)
z = z + 1
End If
y = y + 1
Loop
End Sub |
Partager