Concaténation pied de page vba excel

Résolu
lalalie3 Messages postés 44 Date d'inscription   Statut Membre Dernière intervention   -  
lalalie3 Messages postés 44 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,

Je voudrais savoir comment faire pour concaténer du texte dans un pieds de page.

ci dessous le code complet

Private Sub bt_imprimer_Click()

Dim datedeb As Date, datefin As Date
Dim ddeb As Single, dfin As Single
Dim lignefin As Double

If tb_datedeb = "" Or tb_datefin = "" Then
    MsgBox ("Veuillez saisir la date de début et de fin")
    Exit Sub
End If
    
    datedeb = CDate(Format(tb_datedeb, "dd/mm/yyyy"))
    datefin = CDate(Format(tb_datefin, "dd/mm/yyyy"))

If datefin < datedeb Then
        MsgBox ("La date de fin ne peut être inferieure à la date de début.")
    Exit Sub
End If

ddeb = datedeb
dfin = datefin
Sheets("Planning").Activate
Range("E4").AutoFilter Field:=6, Criteria1:=" >= " & ddeb, Operator:=xlAnd, Criteria2:=" <= " & dfin
'Mise en page
lignefin = Range("F4").End(xlDown).Row
Columns("C:E").EntireColumn.Hidden = True
Columns("K:L").EntireColumn.Hidden = True
Columns("CA:CH").EntireColumn.Hidden = True
With ActiveSheet.PageSetup
    .PrintTitleRows = "$1:$4"
    .PrintTitleColumns = "$B:$N"
    .CenterHeader = _
    "&""Arial,Gras," & "PLANNING du " & Format(datedeb, "d mmm") & " au " & Format(datefin, "d mmm yyyy")
    .CenterFooter = "Imprimer le &D"
    .RightFooter = "&P/&N"
'    .LeftFooter = "activesheets("Paramétrages")range("F2") & " " & range("G2") & " "& range("H2") & " " & range("I2") & " " & range("J2") & " " &range("K2")"    .PrintArea = "$B$4:$CI$" & lignefin
    .PaperSize = xlPaperA4
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.5)
    .BottomMargin = Application.InchesToPoints(0.5)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .Orientation = xlLandscape
End With
Unload usf_Imprimer
Worksheets("Planning").PrintPreview
''Remise en l'etat
Worksheets("Planning").AutoFilterMode = "False"
Columns("K:L").EntireColumn.Hidden = False

'Selection.AutoFilter Field:=6

End Sub



Dans l'espoire que qqu m'aide ...
AU plaisir de vous lire.
A voir également:

3 réponses

Le Pingou Messages postés 12249 Date d'inscription   Statut Contributeur Dernière intervention   1 458
 
Bonjour,
Au passage qu'est ce qui ne fonctionne pas dans le code ?
0
Mytå Messages postés 2973 Date d'inscription   Statut Contributeur Dernière intervention   953
 
Salut le forum

Une partie de ton code avec la concaténation du LeftFooter

Dim WS As Worksheet
Set WS = Sheets("Paramétrages")

'...

With ActiveSheet.PageSetup
    .PrintTitleRows = "$1:$4"
    .PrintTitleColumns = "$B:$N"
    .CenterHeader = _
    "&""Arial,Gras," & "PLANNING du " & Format(datedeb, "d mmm") & " au " & Format(datefin, "d mmm yyyy")
    .CenterFooter = "Imprimer le &D"
    .RightFooter = "&P/&N"
    .LeftFooter = WS.Range("F2") & " " & WS.Range("G2") & " " & WS.Range("H2") & " " & WS.Range("I2") & " " & WS.Range("J2") & " " & WS.Range("K2")
    .PrintArea = "$B$4:$CI$" & lignefin
    .PaperSize = xlPaperA4
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.5)
    .BottomMargin = Application.InchesToPoints(0.5)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .Orientation = xlLandscape
End With

'...

Mytå
0
lalalie3 Messages postés 44 Date d'inscription   Statut Membre Dernière intervention  
 
Bonjour,
MERCI BEAUCOUP !!!!!
Ca fonctionne !!!
Que du bonheur !
0