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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB code to put page header on excel spreadsheet

Status
Not open for further replies.

cassidybklyn

Programmer
Apr 23, 2007
82
US
Could someone please show me how I can put a page header on a spreadsheet, using VB6. Also, I want the header to repeat at every page when printed.

In the routine that does the PageSetup, I don't know if the code below can accomplish that:

With ActiveSheet.PageSetup
.PrintTitleColumns = "Class of 2007"
End With.

Example of how I want the spreadsheet to look:

Class of 2007
-------------
LastName:FirstName:Age:
--------:---------:----
Johnston:Gaberiela:28

Thanks.
C.
 
I'm a lazy slob (but good at it), so here is what I do if I don't know the syntax or commands:
1. Open a spreadsheet
2. Click "Tools | Macros | Record New.."
3. Create the header, etc.
4. Click the "Stop Recording" button.
5. Click "Tools | Macros | Edit" and see what was generated.
6. Tailor to my case....


Learn from the mistakes of others. You won't live long enough to make all of them yourself.
 




Cassedy,

This is ALSO in the Page Setup Window on the Header/Footer Tab.

Same Macro record process.

Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top