Senin, 26 September 2011

RE: [ExcelVBA] Re: Code to Enter Header Information

 

I just ran the folling in a worksheet module in Excel 2003:

Option Explicit

Sub xxx()
ActiveSheet.PageSetup.CenterHeader = "&28SFC 052" & Chr(10) & "&20&A"
& Chr(10) & "&16&D&"" - ""&T"
End Sub

It worked fine. The three lines are there. However, your font sizes
are quite large, and the second and third lines were pushed down far
enough that they were on top of (or beneath) the actual data from the
sheet. You would need to adjust your margins to fit the big header.

You haven't said what version of Excel you're using. But it works fine
for me in 2003.

Regards, Dave S

________________________________

From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On
Behalf Of sspatriots
Sent: Tuesday, 27 September 2011 11:03
To: ExcelVBA@yahoogroups.com
Subject: [ExcelVBA] Re: Code to Enter Header Information

I'm always getting the third row cut off, which should be the Date and
time. When you go back and click on the header, it is as if the third
row is created, but nothing is there. That is, it does a hard return and
creates the row, but nothing else appears.

If I ran the macro to put it in now, I'd want the Header to look like
the following:

SFC 052
Brake-092611
09/26/2011 - 9:00 PM

--- In ExcelVBA@yahoogroups.com <mailto:ExcelVBA%40yahoogroups.com> ,
"Green" <1z@...> wrote:
>
> Hey Steve,
>
> You know me... The devil is in the details... LOL!
>
> What exactly do you expet and what exactly are you getting?
>
> What's being "cut off"?
> What's the full line of code?
>
> Lisa
>
>
> > Subject: [ExcelVBA] Code to Enter Header Information
> >
> > Hi,
> >
> > I have the following in a code to add information on three lines:
> >
> > .CenterHeader = "&28SFC 052" & Chr(10) & "&20&A" & Chr(10) &
> > "&16&D&"" - ""&T"
> >
> >
> > Its supposed to have "SFC 052" on the top line, the Tab Name
> > on the second line and the Date and Time on the third line.
> >
> > For some reason, it is cutting off the Date & Time third row
> > every time. Any ideas as to why this might be happening,
> > please let me know.
> >
> >
> > Thanks,
> >
> > Steve
>

----------

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.

UBS reserves the right to retain all messages. Messages are protected
and accessed only in legally justified cases.

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar