Help on making sure all the data is filled in

Zimmerman

Well-known Member
Joined
Jan 22, 2009
Messages
663
Can someone help me with this. I have a spreadsheet that our sales department fills out. They enter a lot of different data in cells all around the sheet which is important information that our production staff and our shipping staff needs, and sometime they fail to enter all of it which leaves questions. I would like to have the screen flash what cells need to be filled in before they save the sheet. Is it possible?

Thanks in advance
Jamie:confused:
 
Try this

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim MyRng As String, MissingList As String, c As Range
With Sheets("Master")
    If .Range("AA18").Value = "Yes" Then
        MyRng = "AA18, C2, J2, M2, D51, K51"
    Else
        MyRng = "AA18, C2, J3"
    End If
        If WorksheetFunction.CountA(.Range(MyRng)) < .Range(MyRng).Count Then
            Cancel = True
            For Each c In .Range(MyRng)
                If c.Value = "" Then MissingList = MissingList & c.Address(False, False) & ", "
            Next c
            MsgBox "You must complete " & Left(MissingList, Len(MissingList) - 2) & vbCrLf & "Save cancelled!", vbExclamation
        End If
End With
End Sub
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Absolute genius!! Thanks so much!!

Where did you or how did you learn so much about this?

Thanks again for everything!!

Jamie Zimmerman
 
Upvote 0
Making cells blink is not straightforward and most users find it intensely irritating after a while.

This will colour the missing cells red.

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim MyRng As String, MissingList As String, c As Range
With Sheets("Master")
    If .Range("AA18").Value = "Yes" Then
        MyRng = "AA18, C2, J2, M2, D51, K51"
    Else
        MyRng = "AA18, C2, J3"
    End If
        .Range(MyRng).Interior.ColorIndex = xlNone
        If WorksheetFunction.CountA(.Range(MyRng)) < .Range(MyRng).Count Then
            Cancel = True
            For Each c In .Range(MyRng)
                If c.Value = "" Then
                    MissingList = MissingList & c.Address(False, False) & ", "
                    c.Interior.ColorIndex = 3
                End If
            Next c
            MsgBox "You must complete " & Left(MissingList, Len(MissingList) - 2) & vbCrLf & "Save cancelled!", vbExclamation
        End If
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,310
Messages
6,124,187
Members
449,147
Latest member
sweetkt327

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top