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
| Public Sub calculatu()
Static i As Integer
i = 0
ThisWorkbook.Worksheets(1).Cells(1, 2) = i + 1
End Sub
Public Sub constructform()
Dim feuille As Worksheet, rngp As Range, rngv As Range
Dim zlist As DropDown, compteur As Long, opt As OptionButton
Set feuille = ThisWorkbook.Worksheets(1)
Set rngp = feuille.Cells(1, 1)
With feuille.Buttons.Add(rngp.Left, rngp.Top, rngp.Width, rngp.Height)
.Caption = "calcul now"
.OnAction = "calculatu"
End With
End Sub |