Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Requiring Cell Input
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Requiring a value in a cell before allowing user to print | Excel Programming | |||
Requiring Cell Content on Save | Excel Discussion (Misc queries) | |||
Requiring "Explanation" when changing number in cell | Excel Programming | |||
MsgBox or like it for with requiring user input | Excel Programming | |||
Fields requiring input | Excel Programming |