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
| Dim myrange As Range
Dim myrange2 As Range
Dim myrange3 As Range
Dim myrange4 As Range
Dim myrange5 As Range
Dim myrange6 As Range
Dim startX As Variant
Dim L As Integer
Dim m As String
Private Sub ok_Click()
Set myrange = Worksheets("essai").Columns("N:N")
Set myrange2 = Worksheets("essai").Columns("S:S")
Set myrange3 = Worksheets("essai").Columns("X:X")
Set myrange4 = Worksheets("essai").Columns("AC:AC")
Set myrange5 = Worksheets("essai").Columns("AH:AH")
Set myrange6 = Worksheets("essai").Columns("AM:AM")
startX = Application.WorksheetFunction.Min(myrange, myrange2, myrange3, myrange4, myrange5, myrange6)
MsgBox startX
X = starX.address
Listbox1.clear
Me.ListBox1.AddItem
Me.ListBox1.List(cpt, 0) = Worksheets(1).Cells(x, 3).Value
Me.ListBox1.List(cpt, 1) = Worksheets(1).Cells(x, 4).Value
Me.ListBox1.List(cpt, 2) = Worksheets(1).Cells(x, 5).Value
Me.ListBox1.List(cpt, 3) = Worksheets(1).Cells(x, 6).Value
Me.ListBox1.List(cpt, 4) = Worksheets(1).Cells(x, 7).Value
Me.ListBox1.List(cpt, 5) = Worksheets(1).Cells(x, starX).Value
cpt = cpt + 1
End Sub |
Partager