Bonjour,
Je dois créer un bouton qui me permet d'ajouter un contributeur et par la suite parcourir toute les feuilles qui commence par PT_* et ajouter des colonnes avec le nom du contributeur .Tout en étant débutant sur les macros VBA j'ai essayer de faire la macro suivante :
Private Sub btn_ok_Click()
'FEUILLE CONFIG
Sheets("Config").Select
i = 6
Do While Range("B" & i).Value <> ""
i = i + 1
Loop
Range("B" & i).Value = TextBox1.Text
Range("C" & i).Value = TextBox2.Text
Range("D" & i).Value = TextBox3.Text
Range("E" & i).Value = TextBox4.Text
Dim Current As Worksheet
' Loop through all of the worksheets in the active workbook.
For Each Current In Worksheets
'If Left(Current.Name, 3) = "PT_" Then
If Current.Name = "PT_ysf" Then
Current.Select
Range("I5:I284").Select
Selection.Copy
i = 9
Do While Cells(5, i + 3).Value <> ""
i = i + 3
Loop
Cells(5, i + 3).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End If
Next
NewContributor.Hide
End Sub
Merci d'avance pour votre aide
Ci-joint le fichier :
https://www.cjoint.com/c/EIppLCZAvfW