VBA code to stop 2 entries not being signed off

danbates

Active Member
Joined
Oct 8, 2017
Messages
377
Office Version
  1. 2016
Platform
  1. Windows
Hi,

Please can someone help produce a code to do the following:

Column I = Scan out QTY.
Column J = Sign off userform triggers when there's a value in I

Basically what I would like is to prevent there being 2 values in column I that haven't been signed off.

I hope this makes sense and any help would be much appreciated.

Thanks

Dan
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Update: This is what I've got so far

Code:
    Dim rQTYLook As Range   
    Set rQTYLook = Range("I5:I50000")
    Dim wf As WorksheetFunction
    Set wf = Application.WorksheetFunction
    If Intersect(Target, rQTYLook) Is Nothing Then Exit Sub
    
    If Target.Cells.Value > 0 And Target.Offset(0, 1).Value = "" Then
    MsgBox "enter sign off"
    End If
    
    
    If wf.CountA(rQTYLook) < 2 Then Exit Sub
    
    Application.EnableEvents = False


    Target.Value = ""
    Target.Cells.Select
    MsgBox "Only one entry allowed"
    
    Application.EnableEvents = True

It works fine for one entry but when there are 2 entries in column I that haven't been signed off in column J it triggers both messages.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,812
Members
449,048
Latest member
greyangel23

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