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
|
Dim feuille, marque, DernLigneOnd, name, w As String
Dim fichiertravail, fichieronduleur, fichierprojet, fichierpanneaux As String
Dim i As Integer
Private Sub Menu_Initialize()
DELTACheckBox = True
HUAWEICheckBox = True
KACOCheckBox = True
SMACheckBox = True
ABBCheckBox = True
SCHNEIDERCheckBox = True
PHOTOWATTCheckBox = True
Call déclaration
If DELTACheckBox = True And Workbooks(fichiertravail).Sheets("DELTA").Cells(2, 1) <> "" Then
Sheets("DELTA").Copy After:=Workbooks(fichiertravail). _
Sheets(Workbooks(fichiertravail).Sheets.Count)
End If
If HUAWEICheckBox = True And Workbooks(fichiertravail).Sheets("HUAWEI").Cells(2, 1) <> "" Then
Sheets("HUAWEI").Copy After:=Workbooks(fichiertravail). _
Sheets(Workbooks(fichiertravail).Sheets.Count)
End If
If KACOCheckBox = True And Workbooks(fichiertravail).Sheets("KACO").Cells(2, 1) <> "" Then
Sheets("KACO").Copy After:=Workbooks(fichiertravail). _
Sheets(Workbooks(fichiertravail).Sheets.Count)
End If
If SMACheckBox = True And Workbooks(fichiertravail).Sheets("SMA").Cells(2, 1) <> "" Then
Sheets("SMA").Copy After:=Workbooks(fichiertravail). _
Sheets(Workbooks(fichiertravail).Sheets.Count)
End If
If ABBCheckBox = True And Workbooks(fichiertravail).Sheets("ABB").Cells(2, 1) <> "" Then
Sheets("ABB").Copy After:=Workbooks(fichiertravail). _
Sheets(Workbooks(fichiertravail).Sheets.Count)
End If
If SCHNEIDERCheckBox = True And Workbooks(fichiertravail).Sheets("SCHNEIDER").Cells(2, 1) <> "" Then
Sheets("SCHNEIDER").Copy After:=Workbooks(fichiertravail). _
Sheets(Workbooks(fichiertravail).Sheets.Count)
End If
If PHOTOWATTCheckBox = True And Workbooks(fichiertravail).Sheets("PHOTOWATT").Cells(2, 1) <> "" Then
Sheets("PHOTOWATT").Copy After:=Workbooks(fichiertravail). _
Sheets(Workbooks(fichiertravail).Sheets.Count)
End If
fichiertravail = "Fichier travail macro v2.xlsm"
fichierpanneaux = "Fichier panneaux PVSYST.xlsx"
fichieronduleur = "Fichier Ond PVSYST.xlsm"
fichierprojet = "Pré-étude calepinage Onduleur.xls"
End Sub
Private Sub ABBCheckBox_Click()
Call déclaration
If ABBCheckBox.Value = False Then
Workbooks(fichiertravail).Sheets("ABB").Delete
ElseIf ABBCheckBox.Value = True And Workbooks(fichieronduleur).Sheets("ABB").Cells(2, 1) <> "" Then
'--------------Copie de la feuille d'origine
Workbooks(fichieronduleur).Sheets("ABB").Copy After:=Workbooks(fichiertravail). _
Sheets(Workbooks(fichiertravail).Sheets.Count)
End If
End Sub
Private Sub BoutonABB_Click()
marque = "ABB"
feuille = "ABBusf"
Workbooks(fichiertravail).Sheets("ABB").Select
Load VBA.UserForms.Add(feuille) '--------------Je ne comprend pas l'utilité de cette ligne...
VBA.UserForms.Add(feuille).Show '-------------C'est cette commande qui ouvre la deuxième UserForm
End Sub |
Partager