Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" a écrit dans le message de
news:%
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" <christian.lecossier@voila.fr> a écrit dans le message de
news:%23ijinwBYEHA.1152@TK2MSFTNGP09.phx.gbl...
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" a écrit dans le message de
news:%
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" a écrit dans le message de
news:%
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" <christian.lecossier@voila.fr> a écrit dans le message de
news:%23ijinwBYEHA.1152@TK2MSFTNGP09.phx.gbl...
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" a écrit dans le message de
news:%
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" a écrit dans le message de
news:%
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" <christian.lecossier@voila.fr> a écrit dans le message de
news:%23ijinwBYEHA.1152@TK2MSFTNGP09.phx.gbl...
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" a écrit dans le message de
news:%
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
Je ne comprends pas où est ton problème.
Si c'est toujours le même texte que tu utilises, tu l'insères directement
dans la ligne de code, si c'est un texte qui
est variable, tu utilises une variable.
Tu peux utiliser la procédure donnée avec cet événement dans le
ThisWorkbook et tu n'auras plus qu'à appeler la commande
"imprimer".
Si ton texte doit être inséré en dur , utilise cette syntaxe : .LeftHeader
= "&""Arial,Gras""&16Denis"
"Denis" étant le texte que tu désires voir apparaître dans le coin
supérieur gauche.
'-------------------------
Private Sub Workbook_BeforePrint(Cancel As Boolean)
' La procédure
End Sub
'-------------------------
Salutations!
"Christian.L" a écrit dans le message de
news:
Merci pour la réponse
J'avais bien utilisé ce principe, mais l'idée c'est que le "Texte" est
déjà
écrit et on ne veux pas le modifier
C.L.
"michdenis" a écrit dans le message de
news:%Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" a écrit dans le message de
news:%Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la
police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
Je ne comprends pas où est ton problème.
Si c'est toujours le même texte que tu utilises, tu l'insères directement
dans la ligne de code, si c'est un texte qui
est variable, tu utilises une variable.
Tu peux utiliser la procédure donnée avec cet événement dans le
ThisWorkbook et tu n'auras plus qu'à appeler la commande
"imprimer".
Si ton texte doit être inséré en dur , utilise cette syntaxe : .LeftHeader
= "&""Arial,Gras""&16Denis"
"Denis" étant le texte que tu désires voir apparaître dans le coin
supérieur gauche.
'-------------------------
Private Sub Workbook_BeforePrint(Cancel As Boolean)
' La procédure
End Sub
'-------------------------
Salutations!
"Christian.L" <christian.lecossier@voila.fr> a écrit dans le message de
news:eyPcuPDYEHA.212@TK2MSFTNGP12.phx.gbl...
Merci pour la réponse
J'avais bien utilisé ce principe, mais l'idée c'est que le "Texte" est
déjà
écrit et on ne veux pas le modifier
C.L.
"michdenis" <michdenis@hotmail.com> a écrit dans le message de
news:%23mqtJpCYEHA.1152@TK2MSFTNGP09.phx.gbl...
Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" <christian.lecossier@voila.fr> a écrit dans le message de
news:%23ijinwBYEHA.1152@TK2MSFTNGP09.phx.gbl...
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la
police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
Je ne comprends pas où est ton problème.
Si c'est toujours le même texte que tu utilises, tu l'insères directement
dans la ligne de code, si c'est un texte qui
est variable, tu utilises une variable.
Tu peux utiliser la procédure donnée avec cet événement dans le
ThisWorkbook et tu n'auras plus qu'à appeler la commande
"imprimer".
Si ton texte doit être inséré en dur , utilise cette syntaxe : .LeftHeader
= "&""Arial,Gras""&16Denis"
"Denis" étant le texte que tu désires voir apparaître dans le coin
supérieur gauche.
'-------------------------
Private Sub Workbook_BeforePrint(Cancel As Boolean)
' La procédure
End Sub
'-------------------------
Salutations!
"Christian.L" a écrit dans le message de
news:
Merci pour la réponse
J'avais bien utilisé ce principe, mais l'idée c'est que le "Texte" est
déjà
écrit et on ne veux pas le modifier
C.L.
"michdenis" a écrit dans le message de
news:%Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" a écrit dans le message de
news:%Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la
police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
Je ne comprends pas où est ton problème.
Si c'est toujours le même texte que tu utilises, tu l'insères directement
dans la ligne de code, si c'est un texte qui
est variable, tu utilises une variable.
Tu peux utiliser la procédure donnée avec cet événement dans le
ThisWorkbook et tu n'auras plus qu'à appeler la commande
"imprimer".
Si ton texte doit être inséré en dur , utilise cette syntaxe : .LeftHeader
= "&""Arial,Gras""&16Denis"
"Denis" étant le texte que tu désires voir apparaître dans le coin
supérieur gauche.
'-------------------------
Private Sub Workbook_BeforePrint(Cancel As Boolean)
' La procédure
End Sub
'-------------------------
Salutations!
"Christian.L" a écrit dans le message de
news:
Merci pour la réponse
J'avais bien utilisé ce principe, mais l'idée c'est que le "Texte" est
déjà
écrit et on ne veux pas le modifier
C.L.
"michdenis" a écrit dans le message de
news:%Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" a écrit dans le message de
news:%Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la
police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
Je ne comprends pas où est ton problème.
Si c'est toujours le même texte que tu utilises, tu l'insères directement
dans la ligne de code, si c'est un texte qui
est variable, tu utilises une variable.
Tu peux utiliser la procédure donnée avec cet événement dans le
ThisWorkbook et tu n'auras plus qu'à appeler la commande
"imprimer".
Si ton texte doit être inséré en dur , utilise cette syntaxe : .LeftHeader
= "&""Arial,Gras""&16Denis"
"Denis" étant le texte que tu désires voir apparaître dans le coin
supérieur gauche.
'-------------------------
Private Sub Workbook_BeforePrint(Cancel As Boolean)
' La procédure
End Sub
'-------------------------
Salutations!
"Christian.L" <christian.lecossier@voila.fr> a écrit dans le message de
news:eyPcuPDYEHA.212@TK2MSFTNGP12.phx.gbl...
Merci pour la réponse
J'avais bien utilisé ce principe, mais l'idée c'est que le "Texte" est
déjà
écrit et on ne veux pas le modifier
C.L.
"michdenis" <michdenis@hotmail.com> a écrit dans le message de
news:%23mqtJpCYEHA.1152@TK2MSFTNGP09.phx.gbl...
Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" <christian.lecossier@voila.fr> a écrit dans le message de
news:%23ijinwBYEHA.1152@TK2MSFTNGP09.phx.gbl...
Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la
police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.
Bonjour Christian,
Je ne comprends pas où est ton problème.
Si c'est toujours le même texte que tu utilises, tu l'insères directement
dans la ligne de code, si c'est un texte qui
est variable, tu utilises une variable.
Tu peux utiliser la procédure donnée avec cet événement dans le
ThisWorkbook et tu n'auras plus qu'à appeler la commande
"imprimer".
Si ton texte doit être inséré en dur , utilise cette syntaxe : .LeftHeader
= "&""Arial,Gras""&16Denis"
"Denis" étant le texte que tu désires voir apparaître dans le coin
supérieur gauche.
'-------------------------
Private Sub Workbook_BeforePrint(Cancel As Boolean)
' La procédure
End Sub
'-------------------------
Salutations!
"Christian.L" a écrit dans le message de
news:
Merci pour la réponse
J'avais bien utilisé ce principe, mais l'idée c'est que le "Texte" est
déjà
écrit et on ne veux pas le modifier
C.L.
"michdenis" a écrit dans le message de
news:%Bonjour Christian,
À titre d'exemple :
'-------------------------------
Sub Imprimer()
Dim LeTexte As String
LeTexte = "Montréal"
With ActiveSheet.PageSetup
.LeftHeader = "&""Arial,Gras italique""&12&" & LeTexte
.CenterHeader = "&A" 'Le nom de la feuille
' NoPage/NbPages'Le nombre de pages
.RightHeader = "Pages &P+/&P"
End With
ActiveSheet.PrintPreview
End Sub
'-------------------------------
Les variables utilisables avec XP
&L Left aligns the characters that follow.
&C Centers the characters that follow.
&R Right aligns the characters that follow.
&E Turns double-underline printing on or off.
&X Turns superscript printing on or off.
&Y Turns subscript printing on or off.
&B Turns bold printing on or off.
&I Turns italic printing on or off.
&U Turns underline printing on or off.
&S Turns strikethrough printing on or off.
&D Prints the current date.
&T Prints the current time.
&F Prints the name of the document.
&A Prints the name of the workbook tab.
&P Prints the page number.
&P+number Prints the page number plus the specified number.
&P-number Prints the page number minus the specified number.
&& Prints a single ampersand.
& "fontname" Prints the characters that follow in the specified
font. Be sure to include the double quotation marks.
&nn Prints the characters that follow in the specified font size.
Use a two-digit number to specify a size in points.
&N Prints the total number of pages in the document.
Salutations!
"Christian.L" a écrit dans le message de
news:%Bonjour à tous
Comment peut t'on formater les en tête et pied de page (nom de la
police,
style et taille) sans toucher au texte déjà présent dans ceux ci.
Merci d'avance
C.L.