Private encours As Range, quoi
Private encours As Range, quoi Private Sub ComboBox1_Click() If ComboBox1.ListIndex >= 0 Then encours.Value = ComboBox1.List(ComboBox1.ListIndex) End If ComboBox1.Visible = False End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Column = 2 Then If ComboBox1.ListIndex < 0 And Not encours Is Nothing Then encours.Value = quoi End If derlig = Worksheets("entreprises").Range("A" & Rows.Count).End(xlUp).Row With ComboBox1 .ListFillRange = "entreprises!A1:A" & derlig .Top = Target.Top .Left = Target.Left .Height = Target.Height .Width = Target.Width .ListIndex = -1 .Visible = True End With Set encours = Target Else Set encours = Nothing End If End Sub
If Target.Column = 2 Then
If Target.Column = 2 And Target.Row > 7 Then
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub Worksheet_Activate() bridons End Sub Private Sub Worksheet_Change(ByVal Target As Range) Set encours = ActiveSheet If Target.Count > 1 Then Exit Sub If Target.Column <> 1 Or Target.Value = "" Then Exit Sub On Error Resume Next xx = Worksheets(Target.Value).Name If Err <> 0 Then With Worksheets.Add .Name = Target.Value End With encours.Activate On Error GoTo 0 Else MsgBox "cette entreprise a déjà été créée !" Target.Value = "" End If End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) bridons On Error Resume Next If Target.Column <> 1 Or Target.Count > 1 Then Exit Sub If Target.Value <> "" Then MsgBox "non modifiale" End If End Sub Private Sub bridons() If Columns(2).EntireColumn.Hidden = False Then Range(Cells(1, 2), Cells(Rows.Count, Columns.Count)).EntireColumn.Hidden = True End If End Sub
- je filtre dans la BD sur chaque entreprise, et concatène avec condition:
*si en colonne H cellule vide, concaténer D et L sur la feuille de l'entreprise concernée en colonne A (à partir de A7)
*si en colonne H cellule nonvide, concaténer D,H et L sur la feuille de l'entreprise concernée en colonne A (à partir de A7)