![]() |
Prompt user for Customer Name to use info in Header
Hi all. How can I prompt (on Excel Spreadsheet Load ) a user to enter the
name of a customer and have that customer name appear as part of the text in the Header (or footer)? Thanks |
Prompt user for Customer Name to use info in Header
Private Sub Workbook_Open()
Dim nameit As String nameit = InputBox("enter a name") Sheets("Sheet1").PageSetup.CenterFooter = nameit 'or ActiveSheet.PageSetup.CenterFooter = nameit End Sub Gord Dibben MS Excel MVP On Thu, 13 Sep 2007 09:52:07 -0700, Epoh Rio wrote: Hi all. How can I prompt (on Excel Spreadsheet Load ) a user to enter the name of a customer and have that customer name appear as part of the text in the Header (or footer)? Thanks |
Prompt user for Customer Name to use info in Header
Interesting. I am not getting this to work. I placed the code in the
workbook's VBAProject but it does nothing when I open the workbook. Just a warning about macros (macro security set to medium--i also set it to low but nothing still) when i press 'play ' it works perfectly. what am i missing thanks, "Gord Dibben" wrote: Private Sub Workbook_Open() Dim nameit As String nameit = InputBox("enter a name") Sheets("Sheet1").PageSetup.CenterFooter = nameit 'or ActiveSheet.PageSetup.CenterFooter = nameit End Sub Gord Dibben MS Excel MVP On Thu, 13 Sep 2007 09:52:07 -0700, Epoh Rio wrote: Hi all. How can I prompt (on Excel Spreadsheet Load ) a user to enter the name of a customer and have that customer name appear as part of the text in the Header (or footer)? Thanks |
Prompt user for Customer Name to use info in Header
This is event code and goes into Thisworkbook module, not a general module.
With your workbook open, Alt + F11 to go to the VBEditor. Select your workbook/project and expand by clicking on the "+" sign. From Microsoft Excel Objects double-clck on ThisWorkbook module to open it. Paste the code into that module. Save/close and re-open. Gord On Thu, 13 Sep 2007 12:54:00 -0700, Epoh Rio wrote: Interesting. I am not getting this to work. I placed the code in the workbook's VBAProject but it does nothing when I open the workbook. Just a warning about macros (macro security set to medium--i also set it to low but nothing still) when i press 'play ' it works perfectly. what am i missing thanks, "Gord Dibben" wrote: Private Sub Workbook_Open() Dim nameit As String nameit = InputBox("enter a name") Sheets("Sheet1").PageSetup.CenterFooter = nameit 'or ActiveSheet.PageSetup.CenterFooter = nameit End Sub Gord Dibben MS Excel MVP On Thu, 13 Sep 2007 09:52:07 -0700, Epoh Rio wrote: Hi all. How can I prompt (on Excel Spreadsheet Load ) a user to enter the name of a customer and have that customer name appear as part of the text in the Header (or footer)? Thanks |
Prompt user for Customer Name to use info in Header
Thank you Gord, I figured it out before I checked back but you answered my
question correctly. ---------------- One more related question, how can I enter data from a prompt into Sheet2 or a worksheet with a different name, without making that worksheet the current worksheet? |
All times are GMT +1. The time now is 02:42 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com