Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Required cell content

I need to be able to require a person to put initials in the row they are
entering or modifying. Is there a way to make Excel not save until this
information is added?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Required cell content

Let's say your user is entering data in some row in Sheet1 and you want the
initiials in column A.

In worksheet code (for Sheet1) enter:

Private Sub Worksheet_Change(ByVal Target As Range)
myrow = Target.Row
End Sub

This will capture the user's row

In a standard module enter:

Public myrow As Long

This make myrow static & public

In ThisWorkbook code enter:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim mycell As Range
Dim s As String
s = "A" & myrow
Set mycell = Sheets("Sheet1").Range(s)
If IsEmpty(mycell.Value) Then
mycell.Value = InputBox("enter initials: ")
End If
End Sub

So the worksheet code captures the row in which the userentered data.
The ThisWorkbook code uses the row information to test for and propt for the
initials.
--
Gary''s Student


"Catlady" wrote:

I need to be able to require a person to put initials in the row they are
entering or modifying. Is there a way to make Excel not save until this
information is added?

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
Force required entry in cell before leaving that cell Retired Bill Excel Worksheet Functions 8 March 17th 09 10:57 PM
copy comment content to cell content as data not as comment Lilach Excel Discussion (Misc queries) 2 June 21st 07 12:28 PM
Excel - create button to replace cell content with cell value blackmot Excel Worksheet Functions 3 December 7th 05 05:10 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM


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