View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Requiring Cell Input

Try this in the ThisWorkbook module

Private Sub Workbook_BeforeSave _
(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Set magiccell = Sheets("sheet2").Range("a1")
If Len(Application.Trim(magiccell)) < 1 Then
Application.Goto magiccell
MsgBox "Fill in required cell"
Cancel = True
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Scott" wrote in message
...
Hello,

I have a spreadsheet that I use as a form. I'd like to make a madatory
field
that requires input in cell A1. Any ideas on how to require input?

I have one idea to say "when user tries to save, if cell A1 is empty, show
a
message box that states 'Input required in cell A1.' "

I'm open to other ideas too. The easier the solution the better as I'm not
a
VBA programmer.

Scott