Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Warning before saving files!

OK - You guys were such a help with the last question. I have one more.

On the Excel worksheet (which is score sheet), I have two cells that
should have some information, like name and adress, that should be put
into them the 1st time I use the sheet. Sometimes I forget to do. Is
there a way that if I try to save the file without having put the
information into the cells, that Excel will warn me and tell me to
input the data before saving?

Thanks again.

24t42

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 611
Default Warning before saving files!

To get such a warning would require a macro. Here's a non-macro way.

Put this in a cell somewhere, formatted in a large red font. You can
copy/paste it from here.
=IF(AND(OR(NOT(ISBLANK(A2:B6))),OR(E1="",E2=""))," Name and Address
required","")

It's an array formula, so use Ctrl-Shift-Enter instead of Enter. Change the
A2:B6 to the cells where you'll be entering scores. Change E1 and E2 to the
cells for the name and address. If anything has been entered into A2:A6 and
either E1 and/or E2 are empty, it will declare "Name and address required"
loudly in red.

--
Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
wrote in message
oups.com...
OK - You guys were such a help with the last question. I have one more.

On the Excel worksheet (which is score sheet), I have two cells that
should have some information, like name and adress, that should be put
into them the 1st time I use the sheet. Sometimes I forget to do. Is
there a way that if I try to save the file without having put the
information into the cells, that Excel will warn me and tell me to
input the data before saving?

Thanks again.

24t42



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 611
Default Warning before saving files!

Your post is a response to your original post, not to mine, but I'm gonna
assume it was intended to be a response to mine, since I don't see any other
responses. Posts don't always show up in these here parts!

The macro solution will prompt the user when he attempts to save the
workbook. My solution will nag him the moment he has started entering
scores. Either will work, so it's a matter of which you prefer.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Worksheets("Sheet1").Range("E1") = "" Or Worksheets("Sheet1").Range("E2")
= "" Then
MsgBox "You must supply name and address before you save the scoresheet",
vbOKOnly, "Save error"
Cancel = True ' prevent saving
End If
End Sub

Note that this will put the user in a trap if he doesn't have both the name
and address, as he won't be able to proceed. The non-macro solution lets
him know about the problem earlier, before he's entered a mess of score
data. You could actually use both solutions.
--
Earl Kiosterud
www.smokeylake.com

-----------------------------------------------------------------------
wrote in message
ups.com...
I will try that later but I do not object to a macro. Is one way better
than another?

24t42


wrote:
OK - You guys were such a help with the last question. I have one more.

On the Excel worksheet (which is score sheet), I have two cells that
should have some information, like name and adress, that should be put
into them the 1st time I use the sheet. Sometimes I forget to do. Is
there a way that if I try to save the file without having put the
information into the cells, that Excel will warn me and tell me to
input the data before saving?

Thanks again.

24t42




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Warning before saving files!

Thank you very much for your help. It must be a great feeling knowing
you helped someone.

Thanks again!
24t42


Earl Kiosterud wrote:
Your post is a response to your original post, not to mine, but I'm gonna
assume it was intended to be a response to mine, since I don't see any other
responses. Posts don't always show up in these here parts!

The macro solution will prompt the user when he attempts to save the
workbook. My solution will nag him the moment he has started entering
scores. Either will work, so it's a matter of which you prefer.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Worksheets("Sheet1").Range("E1") = "" Or Worksheets("Sheet1").Range("E2")
= "" Then
MsgBox "You must supply name and address before you save the scoresheet",
vbOKOnly, "Save error"
Cancel = True ' prevent saving
End If
End Sub

Note that this will put the user in a trap if he doesn't have both the name
and address, as he won't be able to proceed. The non-macro solution lets
him know about the problem earlier, before he's entered a mess of score
data. You could actually use both solutions.
--
Earl Kiosterud
www.smokeylake.com

-----------------------------------------------------------------------
wrote in message
ups.com...
I will try that later but I do not object to a macro. Is one way better
than another?

24t42


wrote:
OK - You guys were such a help with the last question. I have one more.

On the Excel worksheet (which is score sheet), I have two cells that
should have some information, like name and adress, that should be put
into them the 1st time I use the sheet. Sometimes I forget to do. Is
there a way that if I try to save the file without having put the
information into the cells, that Excel will warn me and tell me to
input the data before saving?

Thanks again.

24t42



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
Opening files in folders and subfolders bestie22 Excel Discussion (Misc queries) 1 September 19th 06 05:23 PM
Sharing read-write Excel 2003 files ttt8262 Excel Discussion (Misc queries) 0 April 1st 06 09:39 PM
Saving files with a list of values Sérgio Lopes Excel Discussion (Misc queries) 3 March 28th 06 02:17 PM
French Version of Excel saving CSV Files with a semi-colon jr Excel Discussion (Misc queries) 2 September 14th 05 04:13 PM
saving files Marlis Excel Discussion (Misc queries) 0 August 17th 05 05:56 AM


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

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"