Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
ledy
 
Posts: n/a
Default 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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
allow multiple users on excel spreadsheet Vindell Excel Worksheet Functions 4 September 30th 05 11:35 PM
Display form from an VB application in Excel kuhni Excel Discussion (Misc queries) 0 August 10th 05 06:04 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
Excel 2003 when closing Excel after having opened a project locked for viewing.. password prompt??? braindead Excel Discussion (Misc queries) 0 March 25th 05 01:58 PM
Excel prompt inaccessible to users JT Excel Discussion (Misc queries) 2 February 4th 05 01:35 AM


All times are GMT +1. The time now is 06:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"