Re : erreur de compilation
les macros simple comme passer d une feuille a l autre avec un bouton marchent
celles qui ne marche pas sont du genre:
Sub SaisieDesignation()
Designation = 0
'appel Designation
Designation = AppelDesignation()
'rempli la fiche
If Designation <> "" Then inventdesignation.Show
If Designation = DesignationFind Then modifinventdesignation.Show
'Sheets("Sommaire personnel").Activate
End Sub
--------------------------------------------------------------------------
Function AppelDesignation()
'demande un nom
Designation = InputBox("Entrer une désignation", " Création d'une fiche", "ex: LDV 45")
Set DesignationFind = Sheets("Sommaire fiches").Columns("B:B").Find(Designation, Range("B7"), xlFormulas, xlPart)
If Designation = "" Or Designation = "ex: LDV 45" Then GoTo fin
If DesignationFind Is Nothing Then
'Nouveau nom
Sheets("Sommaire fiches").Unprotect ("1308")
With Sheets("Sommaire fiches")
Sheets("Fiche vierge").Copy before:=Sheets(Worksheets.Count)
ActiveSheet.Name = Designation
ActiveSheet.Unprotect ("1308")
Set NbrDesignation = .Columns("B:B").Find("", Range("B7"), xlValues, xlWhole)
FinList = NbrDesignation.Row
.Cells(FinList, 2).Value = Designation
.Hyperlinks.Add Anchor:=.Cells(FinList, 2), Address:="", SubAddress:="'" & Designation & "'!A1"
' .Range(.Cells(8, 2).Address, .Cells(FinList, 2).Address).Sort key1:=.Range("B8"), order1:=.xlAscending, Header:=xlGuess, ordercustom:=1, MatchCase:=False, Orientation:=xltoptobooom
Sheets(Designation).Cells(3, 4).Value = Designation
'Unload inventdesignation
Sheets("Sommaire fiches").Protect ("1308")
End With
AppelDesignation = Designation
Else: Sheets(Designation).Activate
End If
'AppelDesignation = Designation
'Sheets(Designation).Cells(3, 4).Value = Designation
Sheets(Designation).Activate
fin:
End Function