Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2004

Tip: Looking for answers? Try searching our database.

Validation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Heath Higgins - 30 Dec 2004 21:25 GMT
I would like to have a cell on a spreadsheet configured so if a user tries
to open the speadsheet without populating a specific cell the worksheet
would not save and a msgbox would pop and inform the user that the cell must
be populated. Not concerned at the moment of what data is populated as long
as is there is something in this cell. Any help would be appreciated.

Thanks!
Bob Phillips - 30 Dec 2004 21:34 GMT
Heath,

Trap the BeforeSave evenet like so

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

   If Thisworkbook.Worksheets("Sheet1").Range("A1").Value = ""
     Cancel = True
     MsgBox "Cell A1 must be poulated before saving

End Sub

and maybe also make sure it is saved ebfore exitiing (optional)

Private Sub Workbook_BeforeClose(Cancel As Boolean)
   If Me.Saved = False Then
       MsgBox "Please save before closing."
       Cancel = True
   End If
End Sub

The code goes in the Thisworkbook code module.

Signature

HTH

RP
(remove nothere from the email address if mailing direct)

> I would like to have a cell on a spreadsheet configured so if a user tries
> to open the speadsheet without populating a specific cell the worksheet
[quoted text clipped - 3 lines]
>
> Thanks!
Heath Higgins - 31 Dec 2004 02:46 GMT
cool beans. will give it a try.

thanks!

> Heath,
>
[quoted text clipped - 30 lines]
>>
>> Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.