Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompt user automatically
Hi all,
I am hoping someone can solve this little problem. I have a workboo that has a footer changing all the time and the users arent to computer literate, especially at changing footers. I would like to automate the process with possibly a prompt box o pop-up where a user simply inserts the footer info. It can be triggere upon opening or a command button??? Please, any ideas????? Cheers!!! -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompt user automatically
Sure! Just use the InputBox function in the Workbook_Open event of the
ThisWorkbook object, like so: Option Explicit Public strFooter As String Private Sub Workbook_Open() strFooter = InputBox("Please enter the footer:") End Sub Regards, Wes |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompt user automatically
Hi Wes,
Thank you!!!! Does the information typed into the input box actually copy as a heade because nothing transferred when i typed in information. Cheers!! -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompt user automatically
Hello, gavmer!
Well, actually you do need a little more code to move the text from the input box to the header or footer. I wasn't sure I should get into that without knowing how many worksheets are in the workbook or which header/footer you wanted to change. Let's assume the workbook contains only one sheet and that you want to modify the center footer. Here's how that program code would look. Option Explicit Public strFooter As String Private Sub Workbook_Open() strFooter = InputBox("Please enter the footer:") ActiveSheet.PageSetup.CenterFooter = strFooter End Sub If you wish to modify any other of the headers or footers, just substitute one of the following keywords for ".CenterFooter" in the above example. .LeftHeader .CenterHeader .RightHeader .LeftFooter .RightFooter If the workbook contains two or more worksheets, you'll have to specify the name of the one you want to change, as in the following example. Option Explicit Public strFooter As String Private Sub Workbook_Open() strFooter = InputBox("Please enter the footer:") Sheets("your worksheet name").PageSetup.CenterFooter = strFooter End Sub I hope this explains it better. Regards, Wes |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompt user automatically
|
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompt user automatically
Hi all,
I have another problem unfortunately. This code is listed within template: Option Explicit Public strFooter As String Private Sub Workbook_Open() strFooter = InputBox("Please enter the footer:") Sheets("your worksheet name").PageSetup.CenterFooter = strFooter End Sub I would like for this to apply only when the template is opened and no when the saved workbook is opened. problem is the footer is a referenc and when a user opens the workbook, the original reference from th template can be altered. Any ideas?? -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Prompt user to input data (pop-up box) | Excel Discussion (Misc queries) | |||
If prompt for user data | Excel Discussion (Misc queries) | |||
save prompt for user exit, but no save prompt for batch import? | Excel Discussion (Misc queries) | |||
Help with user prompt | Excel Discussion (Misc queries) | |||
Prompt user to save their file | Excel Programming |