Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How do I set up a prompt to users in an excel template?
I have set up an excel template for use with various companies I trade with.
The template automatically displays 'xxx' where the company name should be inserted, which then the user changes to relevant company name. However, the company name is not always inserted by oversight and i would like to add a prompt which appears as soon as the user creates a new document from the template, requesting that the relevant company name be input. Unfortunately, i have no idea how to do this! |
#2
|
|||
|
|||
Code like this will run each time the workbook opens.
Option Explicit Sub auto_open() Dim myCompanyName As String If ThisWorkbook.Path = "" Then myCompanyName = Trim(InputBox(Prompt:="Please enter company name!")) ThisWorkbook.Worksheets("sheet1").Range("a1").Valu e = myCompanyName End If End Sub The .path will be blank for any new workbook based on that template until the workbook has been saved at least once. The next time you open that workbook (not create a new workbook based on the template), the code will run, but the path will not be "". And the macro doesn't do anything. An alternative. Find a cell adjacent to that company name cell. Format it in big bold red letters: =if(a1<"xxx","","Please enter the company name!") ledy wrote: I have set up an excel template for use with various companies I trade with. The template automatically displays 'xxx' where the company name should be inserted, which then the user changes to relevant company name. However, the company name is not always inserted by oversight and i would like to add a prompt which appears as soon as the user creates a new document from the template, requesting that the relevant company name be input. Unfortunately, i have no idea how to do this! -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
allow multiple users on excel spreadsheet | Excel Worksheet Functions | |||
Display form from an VB application in Excel | Excel Discussion (Misc queries) | |||
Excel Range Value issue (Excel 97 Vs Excel 2003) | Excel Discussion (Misc queries) | |||
Excel 2003 when closing Excel after having opened a project locked for viewing.. password prompt??? | Excel Discussion (Misc queries) | |||
Excel prompt inaccessible to users | Excel Discussion (Misc queries) |