DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   Dynamic setting of Headers (http://www.daniweb.com/forums/thread160872.html)

dinilkarun Dec 5th, 2008 8:54 am
Dynamic setting of Headers
 
hi,

Through VB i want to set the first 3 rows of my excel sheet as HEADER so that those 3 rows will be common header for all the pages when i print them.

Regards,
Dinil

dinilkarun Dec 16th, 2008 9:57 am
Dynamic setting of Headers
 
PLESE help me with the above post

aktharshaik Dec 16th, 2008 10:19 am
Re: Dynamic setting of Headers
 
    Dim Exmp As New Excel.Application
    Dim WB As Excel.Workbook
    Dim Sh As Excel.Worksheet

    Set WB = Exmp.Workbooks.Open("C:\abc.xls")
    Set Sh = WB.ActiveSheet
    Sh.PageSetup.PrintHeadings = True
    Sh.PageSetup.PrintTitleRows = "$1:$3"
    WB.Save
    Exmp.Visible = True
    Set Exmp = Nothing


All times are GMT -4. The time now is 3:03 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC