A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
I have done it without macro just by going in page setup/footer section.
See this file on my Onedrive, hope it helps.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I want to insert the following in the corresponding footers:
In left footer -
Date: 5th July 2016
Place: India
In right footer -
As per our report of even date
For, Ishan Soni & CO.,
Chartered Accountants
( Regd. No. 0012345C )
( ISHAN SONI )
Proprietor
M. No. 0746811
In center footer -
For, M/S Ashok Constructions
( Ashok Jain )
Proprietor
And it should look like this image which I have posted below:
Just like the image, these three things should be in the same line-
And the lines in the Right Footer should be aligned to center, just like in the image.
I tried to do it by inserting a command button in the sheet and giving it the following code:
Private Sub CommandButton1_Click()
Dim WS As Worksheet
Dim HeaderCenter As String
Dim FooterLeft As String
Dim FooterRight As String
Dim FooterCenter As String
'Code for Center Header (Client's Name and Place)
HeaderCenter = Sheet1.Range("B1").Text & Chr(10) & _
Sheet1.Range("B2").Text
'Code for Left Footer (Date and Place)
FooterLeft = "&BDate :" & " " & Sheet1.Range("B4").Text & Chr(10) & _
"Place :" & " " & Sheet1.Range("B5").Text & B & _
Chr(10) & Chr(10) & Chr(10) & Chr(10) & Chr(10) & Chr(10)
'Code for Center Footer (Client's signature)
FooterCenter = Chr(10) & _
"&B For, " & Sheet1.Range("B1").Text & Chr(10) & _
Chr(10) & Chr(10) & Chr(10) & Chr(10) & _
"(" & Sheet1.Range("B7").Text & ")" & Chr(10) & _
Sheet1.Range("B8").Text & B & Chr(10)
'Code for Right Footer (Auditor's signature)
FooterRight = "&B&UAs per our report of even date&U" & Chr(10) & _
"For, " & Sheet1.Range("B10").Text & "," & Chr(10) & _
"Chartered Accountants&B" & Chr(10) & _
"(" & Sheet1.Range("B11").Text & ")" & Chr(10) & _
Chr(10) & _
"&B(" & Sheet1.Range("B12").Text & ")" & Chr(10) & _
Sheet1.Range("B13").Text & Chr(10) & _
"M. No. " & Sheet1.Range("B14").Text
'Code to put Header and Footers
For Each WS In Worksheets
WS.PageSetup.CenterHeader = HeaderCenter
WS.PageSetup.RightFooter = FooterRight
WS.PageSetup.LeftFooter = FooterLeft
WS.PageSetup.CenterFooter = FooterCenter
Next
End Sub
But this is not working. When I check in the print preview, only Center Header and Center Footer is coming.
Please help
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
I have done it without macro just by going in page setup/footer section.
See this file on my Onedrive, hope it helps.
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
how about putting the text into 1 row, 3 column tables with no borders in the header and footer?