VBA code for data validation

sony

Board Regular
Joined
Jun 15, 2002
Messages
126
hi team,
i have a datasheet. I need ecel to validate my data and pick up the wrong record 's invoice no and put it in another sheet for record. the logic will be below:

1) If Mode = FCL, the FullBox must be Y, or else, pick the invoice no (e..g ZF002) and put to sheet2 at cell A1. The logic works for next record (i.e row), in next one, it will pick the ZF003 to sheet2 A2, but this time ZF003 happen 3 times, i only need ZF003 at sheet2 A2 for one time only.

2) the next logic is :
if Mode = MCC, the Full box must be N, so ZF006 and ZF007 is wrong,excel will identify and put the invoice ZF006 and ZF007 to sheet2 at A3 & A4.

In my actual piece of work, i will apply similar logic to many different data check, i just want the idea how to write that and develop myself to complete the full validation, pls help. Thannk you
Book2
ABCD
1Invoice_noFullBoxMode
2ZF001YFCL
3ZF002NFCL
4ZF003NFCL
5ZF003NFCL
6ZF003NFCL
7ZF004YFCL
8ZF005NMCC
9ZF006YMCC
10ZF007YMCC
Sheet1
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,143,737
Messages
5,720,566
Members
422,291
Latest member
Deveshk

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
Top