Bump## anymore t houghts on this Rick?
Bump## anymore t houghts on this Rick?
Sorry about my absence. See if this code will do what you want...
Code:Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim Mnths As Long, Rws As Long, FilledCellCount As Long, WS As Worksheet For Mnths = 1 To 12 Set WS = Worksheets(UCase(Format(28 * Mnths, "mmm"))) For Rws = 5 To 150 If Len(WS.Cells(Rws, "G").Value) Then FilledCellCount = WorksheetFunction.CountA(WS.Cells(Rws, "M").Resize(, 3)) If FilledCellCount <> 3 Then Cancel = True MsgBox "Please check Row #" & Rws & " on sheet """ & WS.Name & """" & _ vbLf & vbLf & "You have an incident filled in Column G for that row " & _ "but you are missing one or more pieces of data in Columns M thru O" WS.Activate Cells(Rws, "M").Resize(, 3).Select Exit Sub End If End If Next Next End Sub
Last edited by Rick Rothstein; 03-17-2013 at 08:31 PM.
no probs Rick will try it out
NO good rick can I send you the actual file and you can look at it?
thanks RIck - code is installed in this workbook but does not work at all - data in incident cell with no data in M N and O cells does not trigger
the code at all![]()
Okay, I'll look at your workbook. You should be able to attach your workbook to your reply (a direct reply, not a quick reply) so anyone here can see it. If you have trouble doing that, you can send it directly to me at rickDOTnewsATverizonDOTnet (replace the upper case letters with the symbols they spell out).
Edit note before going to sleep: I just want to make sure you realize the code I posted only executes when the workbook is closed (the wording in your last message made me wonder on that).
Last edited by Rick Rothstein; 03-18-2013 at 02:31 PM.
Bookmarks