Attribute VB_Name = "Module_MajFeuilleSaisie"
Option Explicit
Option Base 1

Sub MajFeuilleSaisie()
  Dim dest$, tbListes$, tbleurres$, nomChamp$
  
  tbListes = "tb_listes"
  tbleurres = "tb_leurres"
  
  nomChamp = "Meteo"
  dest = "Meteo"
  Call Liste(tbListes, nomChamp, dest)
  
  nomChamp = "Riviere"
  dest = "Riviere"
  Call Liste(tbListes, nomChamp, dest)
  
  nomChamp = Range("Riviere").Value2
  dest = "Secteur"
  Call Liste(tbListes, nomChamp, dest)
  
  nomChamp = "Leurre_type"
  dest = "Leurre_type"
  Call Liste(tbleurres, nomChamp, dest)
  
  nomChamp = Range("Leurre_type")
  dest = "Leurre_categorie"
  Call Liste(tbleurres, nomChamp, dest)
  
End Sub

Sub Liste(tb, nomChamp, dest)
    With Range(dest)
      .Validation.Delete
      If nomChamp <> "" Then
      With .Validation
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
          Formula1:="=INDIRECT(""" & tb & "[" & nomChamp & "]"")"
      End With
      End If
    End With
End Sub

Sub RazTbPeche()
  Dim tb()
  Dim i%, j%
  Dim espece$
  
  espece = "Afficher tout"
  Call FiltrerEspeces(espece)
  
  tb = Range("tb_Peche").Value2
  For i = 1 To UBound(tb)
    For j = 2 To UBound(tb, 2)
      tb(i, j) = ""
    Next j
  Next i
  Range("tb_Peche").Resize(UBound(tb), UBound(tb, 2)) = tb
  
End Sub
