Concaténation pied de page vba excel

Résolu/Fermé
lalalie3 Messages postés 44 Date d'inscription jeudi 14 avril 2011 Statut Membre Dernière intervention 5 août 2011 - 29 juin 2011 à 12:43
lalalie3 Messages postés 44 Date d'inscription jeudi 14 avril 2011 Statut Membre Dernière intervention 5 août 2011 - 30 juin 2011 à 09:03
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 12041 Date d'inscription mercredi 11 août 2004 Statut Contributeur Dernière intervention 22 avril 2024 1 426
29 juin 2011 à 22:05
Bonjour,
Au passage qu'est ce qui ne fonctionne pas dans le code ?
0
Mytå Messages postés 2973 Date d'inscription mardi 20 janvier 2009 Statut Contributeur Dernière intervention 20 décembre 2016 942
30 juin 2011 à 02:23
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 jeudi 14 avril 2011 Statut Membre Dernière intervention 5 août 2011
30 juin 2011 à 09:03
Bonjour,
MERCI BEAUCOUP !!!!!
Ca fonctionne !!!
Que du bonheur !
0