VBA Validation Macro for Inventory Audit

tatertot

New Member
Joined
Apr 10, 2016
Messages
31
Hello All,

I am beginning our company's audit process for assets in currently in production. In doing so, I need the people on the floor to confirm 3 fields that I have supplied a data validation list that will allow: "","Yes","No". The predefined asset data is in columns I:V. What I am requiring is that the first 3 columns (A:C) have "Yes" or "No" selected for each row containing data in columns I:V. Like a validation to the audit before submission back to myself.

I know the set amount of rows that contain predefined asset data. It is I7:V775. There should be "Yes" or "No" in A7:C775. If there is not, then I would like a message to pop up that states where "Yes" or "No" is needed to be completed. I wouldn't want the validation to occur until the end and the employees entering the data click a button labled "validation check". This macro button would then run this macro to verify that A7:C775 have had either "Yes" or "No" selected.

Is this at all possible?? I feel like this is a very lofty thought. But I have come here before to have all my prior lofty requests fulfilled, so I have faith again!

Thanks so much for any assistance anyone can supply!!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I am currently using the following code to callout the invalid fields:

Code:
Sub AuditValidation()

    Dim Rng As Range
    Dim WorkRng As Range
    
    On Error Resume Next
    
    Set WorkRng = Range("A7:C30")
    Set WorkRng = WorkRng.SpecialCells(xlCellTypeBlanks)
    
    If Err = 0 Then
    MsgBox "You did not answer all required questions!"
    End If
    
    If Err <> 0 Then
    MsgBox "All required data is validated and complete for submission"
    End If


    'color only blank cells
    WorkRng.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 6


End Sub
 
Upvote 0

Forum statistics

Threads
1,216,172
Messages
6,129,291
Members
449,498
Latest member
Lee_ray

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