when i'm going to show you today is how
to create a footer with a line above it
i will show you what it looks like first
and so what I'm going to do is I'm going
to run run my little macro that I've got
here and I've got line at the bottom and
i'm going to run it it asks you would
you like to maintain today's date as
static and I say yes so it's not
changing every time I open the file what
i've done is i've saved this as a as a
PDF just so that would be easier to for
you to see the line at the bottom so
this would work also when you printed it
out but here we have our our document
and you can see we have the sales
figures which is a title of the the file
the sheets on sheet1 and it's got
today's date on it and it's got this
line above which kind of breaks up your
data from your information on the bottom
of the sheet so what we're going to do
is I'll show you how to create this so
I'm going to go back to my sheet and I'm
gonna go to my Developer tab so I've
opened up a new module in my visual
basic here and what I'm going to do is
I'm going to name this sub so good i'm
going to call it foot line and then
we're going to do an opening bracket
closing bracket
ok so then the next ad dspaces in here
ok so the next thing we're going to do
is we are going to keep the screen from
updating long we're doing this and then
we're gonna and with active sheet got
page setup so we're going to page setup
and then what we're going to do is we're
gonna we're going to say what we're
going to do for left-footer ok so dot
left-footer we're going to say and then
we're going to put a bracket and then
we're going to put underlying and there
is 33
I have to do this 33 times to get this
line and i played with this for a while
to get it to work
it might be different for you but it
should be and then what we're going to
do
is we're going to ask for i'm in this
code here we're asking for the filename
the center floor so we go we start with
dot center so in the center footer i
have a game set equal and ask for 33
underlying spaces across here and then
I'm the characters in the second in the
second set here is asking for the sheet
name
ok and then we're going to have a
message box come up the message box is
going to ask is you want to maintain
today's data static or do you want to
change every time you open so what I'm
going to do here is I'm gonna go
messagebox the options are going to be
yes no or cancel so if the response is
yes then what I wanted to do is for the
right footer for the right footer and we
have our 33 spaces here gate and then
we're going to say to put in today's
date
ok so if the response is yes then we're
going to ask for today's date using now
to get the a date and then we're
going to format it with the day month
year what we're going to do is we're
going to do an else in case they said so
if they responded know what we're going
to do is just put the day end and the
lot then what we have to do is just end
and the if-then in the width and then we
end the sub
ok so we're going to compile it because
my typing isn't always perfect and it
seems to be okay and so we're going to
run so do you want to maintain today's
date and then you say yes there you go
it works perfectly so that's how you put
a line between your footer and your
document please subscribe