Re Macro (Pause)

  • Thread starter Thread starter Steved
  • Start date Start date
S

Steved

Hello from Steved I am in excel 97

I want to run a macro that opens the footer that I have.
It will pause to allow me to update information in the
right section, then I push the Enter key which it will
close it.

Thankyou
 
Maybe this sub will help out a bit, whilst awaiting better
responses?
(I'm also quite a newbie learning vba)

Put in a general module.
Remark out the left and centre footer lines if not required.
Change the default footers (e.g. "MyLeftF", etc) to taste.

Sub SetFooter()
With ActiveSheet.PageSetup
.LeftFooter = InputBox("SetLeftFooter", "Enter Left
Footer phrase", "MyLeftF")
.CenterFooter = InputBox("SetCentreFooter", "Enter Centre
Footer phrase", "MyCentreF")
.RightFooter = InputBox("SetRightFooter", "Enter Right
Footer phrase", "MyRightF")
End With
End Sub
 
Thought I'd throw this in. You can get your prompt to show the current
footer with something like this:

CurrentFooter = ActiveSheet.PageSetup.LeftFooter
ActiveSheet.PageSetup.RightFooter = InputBox("Set Right Footer", "Enter
Right Footer phrase", CurrentFooter)

The user can change it or keep it. Be aware that the user won't have access
to the buttons that put codes for things like page numbers with this
solution.

Regards from Virginia Beach,

EarlK
-------------------------------------------------------------
 
Hello Max

I am at home at this time, but in about 14 hours when I
return to work I wiil let you know how get on. Once
again thankyou for your reply

-----Original Message-----
Maybe this sub will help out a bit, whilst awaiting better
responses?
(I'm also quite a newbie learning vba)

Put in a general module.
Remark out the left and centre footer lines if not required.
Change the default footers (e.g. "MyLeftF", etc) to taste.

Sub SetFooter()
With ActiveSheet.PageSetup
.LeftFooter = InputBox("SetLeftFooter", "Enter Left
Footer phrase", "MyLeftF")
.CenterFooter = InputBox
("SetCentreFooter", "Enter Centre
 
Maybe this sub will help out a bit, whilst awaiting better
responses? ...
Put in a general module.
Remark out the left and centre footer lines if not required.
Change the default footers (e.g. "MyLeftF", etc) to taste.
[reformatted]
Sub SetFooter()
With ActiveSheet.PageSetup
.LeftFooter = InputBox("SetLeftFooter", _
"Enter Left Footer phrase", "MyLeftF")
.CenterFooter = InputBox("SetCentreFooter", _
"Enter Centre Footer phrase", "MyCentreF")
.RightFooter = InputBox("SetRightFooter", _
"Enter Right Footer phrase", "MyRightF")
End With
End Sub
...

This does allow entering text for the footer parts, but headers and footers are
rich text, so this doesn't allow for formatting. An alternative would be using

Application.Dialogs(xlDialogPageSetup).Show

to display the Page Setup dialog, but I have no idea how to restrict the user to
entering only the right footer.
 
Thankyou Harlan it created the msgbox.
Sub SetFooter()
With ActiveSheet.PageSetup
..RightFooter = InputBox("SetRightFooter", _
"Enter Right Footer phrase", "MyRightF")
End With
End Sub
I put in 18-Aug-03 and this is what I require, but if I
read you correctly it will replace everything I have in
the right hand footer. Is it possible to put in 18-Aug-03
and leave other detail such as page number.

-----Original Message-----
Maybe this sub will help out a bit, whilst awaiting better
responses? ...
Put in a general module.
Remark out the left and centre footer lines if not required.
Change the default footers (e.g. "MyLeftF", etc) to
taste.
[reformatted]
Sub SetFooter()
With ActiveSheet.PageSetup
.LeftFooter = InputBox("SetLeftFooter", _
"Enter Left Footer phrase", "MyLeftF")
.CenterFooter = InputBox("SetCentreFooter", _
"Enter Centre Footer phrase", "MyCentreF")
.RightFooter = InputBox("SetRightFooter", _
"Enter Right Footer phrase", "MyRightF")
End With
End Sub
...

This does allow entering text for the footer parts, but headers and footers are
rich text, so this doesn't allow for formatting. An alternative would be using

Application.Dialogs(xlDialogPageSetup).Show

to display the Page Setup dialog, but I have no idea how to restrict the user to
entering only the right footer.

--
Never attach files.
Snip unnecessary quoted text.
Never multipost (though crossposting is usually OK).
Don't change subject lines because it corrupts Google newsgroup archives.
.
 
Steve, if I read your comments & guessed your intent correctly,
this revised sub might satisfy what you're after.

I've taken what EarlK gave us earlier (i.e. how to get the prompt
to show the current right footer) and assumed that you want
the page number to be shown in the center footer.

Sub SetFooter1()
CurrentFooter = ActiveSheet.PageSetup.RightFooter
With ActiveSheet.PageSetup
.CenterFooter = "&P"
.RightFooter = InputBox("SetRightFooter", _
"Enter Right Footer phrase", CurrentFooter)
End With
End Sub

If you simply want to set the right footer to show
the current date (without any prompts needed),
just change the line ".RightFooter = Inputbox...." to

..RightFooter = "&D"
 
Thankyou Max
-----Original Message-----
Steve, if I read your comments & guessed your intent correctly,
this revised sub might satisfy what you're after.

I've taken what EarlK gave us earlier (i.e. how to get the prompt
to show the current right footer) and assumed that you want
the page number to be shown in the center footer.

Sub SetFooter1()
CurrentFooter = ActiveSheet.PageSetup.RightFooter
With ActiveSheet.PageSetup
.CenterFooter = "&P"
.RightFooter = InputBox("SetRightFooter", _
"Enter Right Footer phrase", CurrentFooter)
End With
End Sub

If you simply want to set the right footer to show
the current date (without any prompts needed),
just change the line ".RightFooter = Inputbox...." to

..RightFooter = "&D"





.
 
Back
Top