View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Compile error for macros

Michael,

The second and third line should be one line...
Sheet1.PageSetup.LeftFooter = ActiveWorkbook.FullName

When a line of code is split up, a line continuation character is needed.
That would be a space followed by the underscore " _" (without the quote marks).

Using the above the code line would look like...
Sheet1.PageSetup.LeftFooter = _
ActiveWorkbook.FullName

Regards,
Jim Cone
San Francisco, CA

"MICHAEL" wrote in message ...
I am trying to create a macros to enter the filepath in
the footer of an excel document. Here is what MS Office's
site said to create:
Sub UpdateFooter()
Sheet1.PageSetup.LeftFooter=
ActiveWorkbook.FullName
End Sub
When I do this I get a compile error expected:expression.
What am I doing wrong?