Require mandatory info input in order for Exel to save changes.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Shared spreadsheet - When data is changed, can each cell have a identifier
requirement flag/alert (to who made the change, for example) in order for the
changes to be saved? No I.D., no saved changes.
 
You could use conditional formatting to flag the cell to make it noticeable,
but no worksheet function is going to prevent the save regardless of whether
the cell is properly filled or not. That's going to take a little VBA code
in the Workbook's _BeforeSave event. It will look something like this
(change sheet name and cell address as required)

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
If Worksheets("worksheetWithCheckCell"). _
Range("cellAddressToCheck") Then
MsgBox "You must make entry here!", vbOKOnly, "Cannot Save"
Worksheets("worksheetWithCheckCell").Select
Range("cellAddressToCheck").Select
Cancel = True
End If
End Sub
 
Enter this code in the ThisWorkbook codemodule. Everytime a cell in th
workbook is changed. A comment will be added to that cell, listing th
time along with some user's name. I'm not really familiar with share
workbooks so this might not be the user who made the change, but som
user's name will be added to the comment. This info will be added t
the comment so it will reflect a running list of when that cell wa
changed.

Code
-------------------
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
On Error Resume Next
Target.AddComment
On Error GoTo 0
With Target.Range("a1").Comment
.Text Text:=.Text & vbCrLf & ThisWorkbook.UserStatus(1, 1) & Format(Now(), "hh:mm-mm/dd")
End With
End Su
 
Look at Track Changes in XL Help ("View the history of changes to a
workbook").
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top