MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 30th, 2004, 04:10 PM   #1
backup69
 
Join Date: Jan 2004
Posts: 260
Default space between rows in header

Hi

Maibe anyone can help.
if i use this
Code:
Set baas = Worksheets("Andmebaas")
mytext = baas.Range("J1").Value & _
vbCrLf & baas.Range("J2").Value & _
vbCrLf & baas.Range("J3").Value & _
vbCrLf & baas.Range("J4").Value & _
vbCrLf & baas.Range("J5").Value & _
vbCrLf & baas.Range("J6").Value & _
vbCrLf & baas.Range("J7").Value
With ActiveSheet.PageSetup
.RightHeader = mytext
End With
my header rows with to big space between rows but should be minimum.
backup69 is offline   Reply With Quote
Old Mar 30th, 2004, 04:20 PM   #2
Zack Barresse
MrExcel MVP
 
Zack Barresse's Avatar
 
Join Date: Dec 2003
Location: Oregon, USA
Posts: 9,624
Default Re: space between rows in header

how about setting it manually in your code...

Code:
Sub printSetup()

    Set baas = Worksheets("Andmebaas")
    mytext = baas.Range("J1").Value & _
    vbCrLf & baas.Range("J2").Value & _
    vbCrLf & baas.Range("J3").Value & _
    vbCrLf & baas.Range("J4").Value & _
    vbCrLf & baas.Range("J5").Value & _
    vbCrLf & baas.Range("J6").Value & _
    vbCrLf & baas.Range("J7").Value
    With ActiveSheet.PageSetup
        .RightHeader = mytext
        
        'set to whatever you want
        .LeftMargin = Application.InchesToPoints(0.5)
        .RightMargin = Application.InchesToPoints(0.25)
        .TopMargin = Application.InchesToPoints(0.5)
        .BottomMargin = Application.InchesToPoints(0.5)
        .HeaderMargin = Application.InchesToPoints(0.25)
        .FooterMargin = Application.InchesToPoints(0.25)
    End With
    
End Sub
hth

ps. congrats on estonia's seat in the un!!
__________________
Regards,
Zack Barresse

All Excel Functions
(If you would like comments in any code, please say so.)
Zack Barresse is offline   Reply With Quote
Old Mar 30th, 2004, 04:49 PM   #3
backup69
 
Join Date: Jan 2004
Posts: 260
Default Re: space between rows in header

TY
yesterday estonia join with NATO http://www.natonews.com/
But this not help me. I need minimise space between rows.
Try make header with this code and u see how ugly this. And worksheet first row above header last row.

still need solution
backup69 is offline   Reply With Quote
Old Mar 30th, 2004, 05:36 PM   #4
backup69
 
Join Date: Jan 2004
Posts: 260
Default Re: space between rows in header

Sry

To simple ( vbLf )
found here
http://www.mrexcel.com/board2/viewtopic.php?t=57219
backup69 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 08:30 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.