ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using an input box to enter information into the header section of page setup (https://www.excelbanter.com/excel-programming/328891-using-input-box-enter-information-into-header-section-page-setup.html)

George Taylor

Using an input box to enter information into the header section of page setup
 
Hi,

I'd like to click a button when I go into a new workbook which prompts me
for the customer name and then puts it into the header section of Page
Setup, is this possible?

If so could someone post the relevant code or point me to a webpage with it,
I've done some checking but can't find it on the web.

Thanks in advance,

George



Tom Ogilvy

Using an input box to enter information into the header section of page setup
 
You would need to institute application level events:

for documentation and some explanation on Application Level Events, you
might want to read Chip Pearson's site
http://www.cpearson.com/excel/appevent.htm

There are several schools of thought on implementing these, but that isn't
critical to this discussion. You would use the application level event to
trigger a macro when a New workbook is opened. In the event you would show
an inputbox

ans = Inputbox("Enter the Customer Name:")

then you would do the pagesetup. (you can get the basic code for this by
recording a macro while you set up a header manually)

--
Regards,
Tom Ogilvy

"George Taylor" wrote in message
...
Hi,

I'd like to click a button when I go into a new workbook which prompts me
for the customer name and then puts it into the header section of Page
Setup, is this possible?

If so could someone post the relevant code or point me to a webpage with

it,
I've done some checking but can't find it on the web.

Thanks in advance,

George






All times are GMT +1. The time now is 02:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com