Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
| Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 19th, 2004, 12:16 PM
Registered User
 
Join Date: Aug 2004
Location: Owensboro, KY, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBA for Excel 2000...HELP!

This may not be the proper place to post this question, but I'm out of ideas of other places to post it. I am NOT a programmer, but find myself in a situation where I must write a macro in VBA for Excel. I'd use the help function to get me through this issue, but it's not loaded on my computer, and my employer unwittingly threw our Office disk away, so I'm stuck.

I need to write a macro to add the file path to Excel worksheet footers. I found one place online that told me how to do this, but it just doesn't work for me. The macro I was given is as follows:

Sub
  UpdateFooter()ActiveSheet.PageSetup.LeftFooter = ActiveWorkbook.FullName
End Sub

The issue is, when I enter this information, it gives me errors telling me that everything in the first part of the macro is expected at the end. As I said, I can't access "help" to figure this out.

If anyone has ANY information that can help me, I would deeply appreciate it.

Thanks in advance.


Lee Hardesty

Everything works out in the end.  If it hasn't worked out, it isn't the end.
 
Old August 19th, 2004, 11:25 PM
Authorized User
 
Join Date: Feb 2004
Location: , , Denmark.
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
Insert the following code in the module named ThisWorkBook

Private Sub Workbook_BeforePrint(Cancel As Boolean)
   ActiveSheet.PageSetup.LeftFooter = ThisWorkbook.FullName
End Sub

Hope it will help you.

Cheers
Karsten

 
Old August 20th, 2004, 09:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , Denmark.
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Another possibility. Under Files - PageSetup you should be able to edit your Footer. Full path should be something like this:

   &[Path]&[File]

However, asking for a macro, you may already have tried it!




Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2000 Create PDF with VBA ralf.schmitt@rsdv.de Excel VBA 8 March 5th, 2008 03:36 PM
Excel 2000 VBA Problems drsammyb Excel VBA 0 January 17th, 2005 11:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.