Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access to excel send &[DATE] and &[PAGE] so it functions

Status
Not open for further replies.

rust

Programmer
Jan 27, 2003
34
US
I'm formatting an excel sheet from Access - works OK accept the footer needs the &[PAGE] and &[DATE] command
When I send it just shows the words but doesn't fill in the PAGE or DATE

Dim objXL As Excel.Application
Set objXL = New Excel.Application

With objXL.ActiveSheet.PageSetup
.CenterFooter = "FirstLine" & Chr(10) & Chr(10) & "Second Line" & Chr(10) & Chr(10) & "&&[Page]" & " of " & "&&[Pages]" & Chr(10) & "&&[Date]"
end with

must be a secret to get it to work
 
Code:
.CenterFooter = "FirstLine" & Chr(10) & Chr(10) & "Second Line" & Chr(10) & Chr(10)  & "&Page" & " of " & "&Pages" & Chr(10) & "&Date"
:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
sorry was too hasty if I use just the "&D" it works accept it takes along time for the excel sheet to load from excel?

but when I directly to print without seeing the sheet on the screen everything is there?

So I tried using &[DATE] and that didn't work at all
 
sorry its
Code:
.CenterFooter = "FirstLine" & Chr(10) & Chr(10) & "Second Line" & Chr(10) & Chr(10)  & "&[Page]" & " of " & "&[Pages]" & Chr(10) & "&[Date]"
Just use SINGLE ampersand.

:)



Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hi Skip,
we are out of phase with each other - thanks for the help -
I really appreciate that there are people out there ready to respond right a way.
 
out of phase"

???

about what?

If I enter
[tt]
&[page]
[/tt]
in an Excel header/footer, a page number is generated at print preview/print time.

???

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
out of phase ment that I replied to my only problem - that I found a fix and by the time I sent it - wonderful people were responding.

just a note when I used &[Page] what I saw in excel was
Page]

the &[ in the beginning wasn't there.

So I figured to be clever I would double up on the &
sending &&[Page]
What showed up in excel
was &[Page] but not the page number.

So when I used the macro recorder I saw it was using &P and &D.

Do I tried that - and it looked like it crashed the excel as the sheet wouldn't load. But after testing a few times it looks like the excel sheet is the way I need it for printing.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top