Display an alert if data already exists

c3rn_nz

New Member
Joined
Apr 4, 2019
Messages
4
Hi everyone, I require some help creating an alert please.

The situation is as follows.
- I have a workbook called Invoices
- There are two sheets in the workbook, one called Current and the other called Processed
- Users enter in pertinent details daily and then a certain user processes the data and moves (cut/paste) the entries from the Current sheet to the one called Processed.
- In column B, users enter an invoice number

I would like to create an alert for when a user enters an invoice number in any row of column B and that invoice number already exists in column B across either of the two sheets.

Ideally a pop up would be displayed, just providing a warning. The user can then choose to close the warning/pop up and continue if they wish.

Any assistance in this matter would be appreciated.
 
Ok so I tried both of the codes supplied but they didn't seem to work. Perhaps I'm not entering them correctly (my first time inserting a macro).

This is how I have it set up in Visual Basics editor. However when I close the editor and purposely try to enter an invoice number that exists, no alerts occur.

What am I doing wrong?

Sshot.jpg
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
from VBA window
In the picture you posted , each sheet is listed in window pane on left
- double click on sheet Current and place code in that module

OR from EXCEL
- right-click on the sheet tab for sheet Currrent \ View Code \ paste code into the window which appears

The alert occurs when invoices are entered in sheet Current
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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