Option Explicit
Sub toto()
Dim x As Integer, y As Integer, maligne As Integer
maligne = Range('G65536').End(xlUp).Row
For x = 2 To maligne
If Range('G' & x) <> '' Then
y = y + 1
Cells(1, y) = Range('G' & x)
End If
Next
Rows('2:' & maligne).Delete
End Sub