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

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,215,020
Messages
6,122,709
Members
449,093
Latest member
Mnur

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