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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
Private Sub CommandButton1_Click() 'Bouton Ajouter le circuit
Application.ScreenUpdating = False
Dim ctrl As Control
Dim colonne As Integer
Dim derligne As Integer
derligne = Sheets("Bilan de puissance circuit term").Range("A1048576").End(xlUp).Row + 1
'Mise en forme de la ligne
Range(cells(derligne, 1), cells(derligne, 22)).Select
If CheckBox1 = True Then
With Selection
.Borders(xlEdgeTop).LineStyle = xlcontinious
.Borders(xlEdgeTop).Weight = xlMedium
.Borders(xlEdgeBottom).LineStyle = xlcontinious
.Borders(xlEdgeBottom).Weight = xlMedium
.Borders(xlEdgeLeft).LineStyle = xlcontinious
.Borders(xlEdgeLeft).Weight = xlMedium
.Borders(xlEdgeRight).LineStyle = xlcontinious
.Borders(xlEdgeRight).Weight = xlMedium
.Borders(xlInsideVertical).LineStyle = xlcontinious
.Borders(xlInsideVertical).Weight = xlThin
.Font.Size = 9
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
Else
With Selection
.Borders(xlEdgeTop).LineStyle = xlcontinious
.Borders(xlEdgeTop).Weight = xlThin
.Borders(xlEdgeBottom).LineStyle = xlcontinious
.Borders(xlEdgeBottom).Weight = xlMedium
.Borders(xlEdgeLeft).LineStyle = xlcontinious
.Borders(xlEdgeLeft).Weight = xlMedium
.Borders(xlEdgeRight).LineStyle = xlcontinious
.Borders(xlEdgeRight).Weight = xlMedium
.Borders(xlInsideVertical).LineStyle = xlcontinious
.Borders(xlInsideVertical).Weight = xlThin
.Font.Size = 9
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
End If
'entré des valeurs du formulaire dans leur cellule respective
cells(derligne, 1) = TextBox1.Value
cells(derligne, 2) = ComboBox1.Value
cells(derligne, 3) = ComboBox3.Value
cells(derligne, 4) = ComboBox2.Value
cells(derligne, 5) = TextBox2.Value
cells(derligne, 7) = TextBox3.Value
cells(derligne, 8) = TextBox5.Value
cells(derligne, 9) = TextBox4.Value
cells(derligne, 12) = ComboBox4.Value
cells(derligne, 13) = ComboBox5.Value
cells(derligne, 21) = ComboBox6.Value
'cellules auxquelles il faut attribuer une formule (""=en attente de formule)
cells(derligne, 10) = Sin(apllication.Acos(TextBox4.Value)) 'essai en entrant directement la formule
cells(derligne, 6) = ""
cells(derligne, 11) = ""
cells(derligne, 14) = ""
cells(derligne, 15) = ""
cells(derligne, 16) = ""
cells(derligne, 17) = ""
cells(derligne, 18) = ""
cells(derligne, 19) = ""
cells(derligne, 20) = ""
cells(derligne, 22) = ""
Unload userform1
End Sub |
Partager