I need to send some reports to users, and ask them to fill some data into.
They should send me back that report.
The problem is they do not always fill data and back it to me, so I want to make mandatory cells using BeforeClose event.
The main idea is that cell in my case is actually difference of values of two other cells, F5=C5-D5; F5 must be zero ("0"). they should fill in C5 and D5.
I found on link some maybe usefull vba, but I do nt know what is need to be done to make it happen (http://www.ozgrid.com/forum/showthread.php?t=20231).
So wanted value in F5 should be zero (0).
thx
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim shtTemp As Object
' add your 5 sheetnames to the array list
For Each shtTemp In Worksheets(Array("Sheet1"))
If shtTemp.Range("F5").Value = "0" Then
MsgBox "You must complete an entry in Cell F5 on sheet " _
& shtTemp.Name, vbOKOnly Or vbExclamation
Cancel = True
Exit For
End If
Next
End Sub
They should send me back that report.
The problem is they do not always fill data and back it to me, so I want to make mandatory cells using BeforeClose event.
The main idea is that cell in my case is actually difference of values of two other cells, F5=C5-D5; F5 must be zero ("0"). they should fill in C5 and D5.
I found on link some maybe usefull vba, but I do nt know what is need to be done to make it happen (http://www.ozgrid.com/forum/showthread.php?t=20231).
So wanted value in F5 should be zero (0).
thx
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim shtTemp As Object
' add your 5 sheetnames to the array list
For Each shtTemp In Worksheets(Array("Sheet1"))
If shtTemp.Range("F5").Value = "0" Then
MsgBox "You must complete an entry in Cell F5 on sheet " _
& shtTemp.Name, vbOKOnly Or vbExclamation
Cancel = True
Exit For
End If
Next
End Sub