Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Require specific cell entry before saving file
I want to require the user to enter his/her name in a specific cell (E59)
before the user can save the file. I tried using Data Validation where I specified Text Length between 1 and 40, and left blank the check-box for "Ignore Blank". Nope. I never programmed in VBA, so I hope there is a simple solution (I might be OK with some simple VBA code). ---Pat |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Require specific cell entry before saving file
Place the following code in the "ThisWorkbook" code sheet........
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Len(Trim(Sheet1.Range("E59"))) = 0 Then MsgBox "Enter name in cell E59 before save", vbCritical + vbOKOnly Cancel = True End If End Sub -- Regards, Nigel "Patrick Riley" wrote in message ... I want to require the user to enter his/her name in a specific cell (E59) before the user can save the file. I tried using Data Validation where I specified Text Length between 1 and 40, and left blank the check-box for "Ignore Blank". Nope. I never programmed in VBA, so I hope there is a simple solution (I might be OK with some simple VBA code). ---Pat |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Require specific cell entry before saving file
Thank you, Nigel. I placed the code in the "ThisWorkbook" code sheet, but it
did not work (I still could save the file with cell E59 being blank. I then substituted the name of the worksheet (Main) for "Sheet1", but that did not work, either. "Nigel" wrote: Place the following code in the "ThisWorkbook" code sheet........ Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Len(Trim(Sheet1.Range("E59"))) = 0 Then MsgBox "Enter name in cell E59 before save", vbCritical + vbOKOnly Cancel = True End If End Sub -- Regards, Nigel "Patrick Riley" wrote in message ... I want to require the user to enter his/her name in a specific cell (E59) before the user can save the file. I tried using Data Validation where I specified Text Length between 1 and 40, and left blank the check-box for "Ignore Blank". Nope. I never programmed in VBA, so I hope there is a simple solution (I might be OK with some simple VBA code). ---Pat |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Require an entry in a cell | Excel Discussion (Misc queries) | |||
Require input in a cell before saving file | Excel Discussion (Misc queries) | |||
Require specific cell entry before saving file | Excel Discussion (Misc queries) | |||
Require specific cell entry before saving file | Excel Discussion (Misc queries) | |||
Require cell entry | Excel Programming |