[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to put date and file name in the footer

Posted on 2010-11-09
5
Medium Priority
?
361 Views
Last Modified: 2012-05-10
I am trying to put date and file name in the footer of a file exported from access and print it with preset alignment.

What is the code for the date and file name.
0
Comment
Question by:alibacha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Expert Comment

by:jkunrein
ID: 34097115
You should be able to use:
&[Date]
for the date.

And you can use:
&[File]
for the file name.
0
 
LVL 59

Accepted Solution

by:
Saurabh Singh Teotia earned 2000 total points
ID: 34097161
You can use something like this to do what you are looking for...
Saurabh...

Sub putfooter()

    With Sheets("Your Sheet name here").PageSetup
     
        .CenterFooter = Format(Now(), "mm/dd/yy") & " " & ThisWorkbook.Name
        
        
    End With
    
End Sub

Open in new window

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34099100
What type of Object are you Exporting?
What format are you exporting it to?
How are you performing the Export (manually or via code)
"and print it with preset alignment."
?
...Can you explain exactly what this means?

Please be specific.


I will presume by what little info on this you posted, that you want some Access Data exported to Excel?

If so, this can easily be done in a Report.

Create the report from your source data.
In the Report footer insert a textbox control and set the control source to: =Date()
Set the name to: txtDate

Then in the Report footer insert another textbox control but leave the control source blank.
Name this control: txtDBName
Then on the Format event of the Report Footer, put code like this:
    Me.txtPath = CurrentProject.Name

See the attached sample.

Study it carefully and I am sure you will be able to adapt it to work in your database.

;-)

JeffCoachman

db310.mdb
0
 
LVL 50
ID: 34415208
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question