-2

I have data in column A and B.
I only look data in column A.
I need to delete whole row, except where there are 3 types of data:

First type (always same format):

0123-21-20-00
9022-02-00-00
0658-81-01-22
etc ...

Second type:

EL-001
EL-022
EL-352
etc ...

Third type:

ST-024
ST-235
ST-055
etc ...
Dominique
  • 16,450
  • 15
  • 56
  • 112

1 Answers1

1

To search and match formats, the best thing to do usually is to use regular expressions. There is a great post about this on stack.

So the whole process would be to loop though all rows, check the format of the cell under column A, and delete the whole row if doesn't fit the format. I'd suggest to go from the bottom row and going up, because deleting a row while looping above it may get tricky.

Your three regex should look like this :

^ST-[0-9]{3}$

^EL-[0-9]{3}$

^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}$
MadDoc
  • 48
  • 4