Sheets("Feuil1").Rows(line & ":" & line).Select
Sheets("Feuil1").Select Rows(line & ":" & line).Select Selection.Insert Shift:=xlDown
'Cette méthode permet d'ajotuer une CheckBox dans la feuille F Sub ajouterCheckbox(f As Worksheet, nameC As String, leftC As Long, topC As Long, widthC As Long, heightC As Long, captionC As String, backColorC As Long, foreColorC As Long) On Error GoTo errAjoutCB 'Déclaration d'un OLEObject pour l'ajout d'une checkbox Dim b As OLEObject Set b = Feuil1.OLEObjects.Add("Forms.CheckBox.1") With b .Name = nameC .Left = leftC .Top = topC .Width = widthC .Height = heightC .Object.Caption = captionC .Object.BackColor = backColorC .Object.ForeColor = foreColorC .ShapeRange.Fill.Visible = msoFalse .ShapeRange.line.Visible = msoFalse .Object.Font.Bold = False .Object.Font.Size = 10 End With Exit Sub errAjoutCB: MsgBox ("Erreur lors de l'ajout des CheckBox.") MsgBox (err.Description) End Stop End Sub 'Et pour l'ajout de procédure : Sub AjouterProcEven(c As Workbook, nomModule As String, evenement As String, objet As String, code As String) On Error GoTo errAjoutProc Dim nextLine As Integer With c.VBProject.VBComponents(nomModule).CodeModule nextLine = .CountOfLines + 1 .InsertLines nextLine, code End With Exit Sub errAjoutProc: MsgBox ("Erreur ajout procedure !") End Exit Sub End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question