Bonjour,
Je suis débutant en vba & Excel.
Lorsque j'ouvre mon fichier excel, une erreur apparait et tous mes contrôle de cellule sont supprimer.
Voici la méthode de création de la validation :
With LineImport.Cells(1, ColValidationCS - 2)
.Font.Bold = True
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Formula1:=ThisWorkbook.ListCSValidation
End With
Dans ThisWorkbook, j'ai :
Option Explicit
Public ListCSValidation As String
Private Sub Workbook_Open()
ListCSValidation = Join(Application.Transpose(ActiveWorkbook.Worksheets("Synthèse").ListObjects("Validation").ListColumns(1).Range().Value), ",")
End Sub
Je pense que lorsque le fichier s'ouvre, "ListCSValidation" n'existe pas et donc une erreur est levé.
Avez-vous une solution pour moi ?
Merci d'avance.