Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default In Excel, how to make a field required so it's not left blank?

I've seen a lot of advise, however I need complete, step-by-step
instructions. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default In Excel, how to make a field required so it's not left blank?

I assume you want to ensure that a cell is filled out before the
workbook is closed. Open the VBA Editor, display the Project
Window (CTRL+R) and open the ThisWorkbook code module. There,
paste the following code:


Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Worksheets("Sheet1").Range("A1").Value = "" Then
MsgBox "You must fill in A1."
Cancel = True
End If
End Sub


Change the Sheet name and cell reference to meet your needs.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"linplex" wrote in message
...
I've seen a lot of advise, however I need complete,
step-by-step
instructions. Thanks!



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
can I make a field in excel spreadsheet required? If yes, How? Ginycub22 Excel Discussion (Misc queries) 0 August 23rd 06 08:30 PM
How do I make a particular column required in Excel? smistretta Charts and Charting in Excel 0 April 24th 06 05:43 PM
Required field message - Excel Steve S via OfficeKB.com Excel Discussion (Misc queries) 2 May 9th 05 04:16 PM
Removing blank characters from left of field tcbootneck Excel Programming 5 December 29th 04 10:37 AM
How do I make a value required in a cell in Excel? ex: Name, Last. Pilar Excel Programming 2 October 6th 04 08:03 PM


All times are GMT +1. The time now is 01:29 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"