View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
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?