Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I make a value required in a cell in Excel? ex: Name, Last.

Users are downloading a spreadsheet where they should be filling in important
values to HR such as Name, Last Name, Social Security, etc.
Besides there are other values such as Standard number of hours they work
(20, 37.5, 40, etc) that are being used to calculate overtime, benefits, etc.
so they must be filled in.

Is there a way to make these fields required before printing/saving the
spreadsheet?
Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default How do I make a value required in a cell in Excel? ex: Name, Last.

Pilar, here is one way, change the range to the cells you want

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim test_rng As Range
Dim ret_str As String
Dim cell As Range

'change to your range
Set test_rng = ActiveSheet.Range("A1:A5,B1")

For Each cell In test_rng
If cell.Value = "" Then
If ret_str = "" Then
ret_str = cell.Address
Else
ret_str = ret_str & " and " & cell.Address
End If
End If
Next
If ret_str < "" Then
MsgBox "There is information missing in cell(s): " & ret_str
Cancel = True
Else

End If

End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 2003
** remove news from my email address to reply by email **

"Pilar" wrote in message
...
Users are downloading a spreadsheet where they should be filling in
important
values to HR such as Name, Last Name, Social Security, etc.
Besides there are other values such as Standard number of hours they work
(20, 37.5, 40, etc) that are being used to calculate overtime, benefits,
etc.
so they must be filled in.

Is there a way to make these fields required before printing/saving the
spreadsheet?
Thank you!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I make a value required in a cell in Excel? ex: Name, Last.

See Events at Chip Pearson's site

http://www.cpearson.com/excel/events.htm

look at the BeforePrint, BeforeSave and BeforeClose events.

You also might want to look at the selectionchange and change events.

--
Regards,
Tom Ogilvy

"Pilar" wrote in message
...
Users are downloading a spreadsheet where they should be filling in

important
values to HR such as Name, Last Name, Social Security, etc.
Besides there are other values such as Standard number of hours they work
(20, 37.5, 40, etc) that are being used to calculate overtime, benefits,

etc.
so they must be filled in.

Is there a way to make these fields required before printing/saving the
spreadsheet?
Thank you!



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
how do I make a cell required to have input? Michele Excel Discussion (Misc queries) 4 April 26th 13 06:00 PM
is it possible to make a cell in excel as entry required max power Excel Discussion (Misc queries) 1 November 8th 06 01:27 PM
can you make a cell value required? nishapurohit Excel Discussion (Misc queries) 2 January 30th 06 11:42 PM
how to make a cell required in excel ncaurora03 Excel Discussion (Misc queries) 1 January 30th 06 06:11 PM
how do I make a cell in Excel required to be populated? Tia Excel Discussion (Misc queries) 1 February 10th 05 12:35 AM


All times are GMT +1. The time now is 05:39 PM.

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

About Us

"It's about Microsoft Excel"