Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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
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
Require an entry in a cell Erika Excel Discussion (Misc queries) 3 September 25th 09 09:15 PM
Require input in a cell before saving file Patrick Riley Excel Discussion (Misc queries) 21 March 26th 08 03:47 PM
Require specific cell entry before saving file Patrick Riley Excel Discussion (Misc queries) 1 March 21st 08 05:46 PM
Require specific cell entry before saving file Patrick Riley Excel Discussion (Misc queries) 2 March 20th 08 04:50 PM
Require cell entry Bernie Deitrick Excel Programming 0 June 24th 04 02:43 PM


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