Help with VBA

tkocity

New Member
Joined
Dec 6, 2005
Messages
4
I'm new to here and new to VB as well...
What I have now is a column of dates, stored as 'Strings' as 'yymmdd', e.g. ''0501201' is the 1st of December 2005.

What I need is to search through this column row by row, and then take out each date ONCE, so for example if i have the following in my column:

'050101
'050101
'050202
'050203
'050202

I only want
'050101
'050202
'050203
to be the result.

Please advice me how I can do this. I have spent days on it and i can't do it! :cry:
 

Some videos you may like

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

tkocity

New Member
Joined
Dec 6, 2005
Messages
4
Sorry can you give me more code? I'm too new to this.. sorry, but thx anyway..
 

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
You can record the macro as you do it manually.

Select the range then go to Data-AdvancedFilter
follow the steps.
sorry I can not help you in details due to the language.

Hope someone else could help you....
 

tkocity

New Member
Joined
Dec 6, 2005
Messages
4

ADVERTISEMENT

OK I got you, i got it too... thanks very much.
But I am preparing this for a user, and so it is much more ideal if set of VBA code is written for it so it works like a programme instead of having to press the Advanced Filter thing all the time... is it possible?
Also, let's say if I change all my dates into numeric values, I want them to accend from smallest to largest, can that be in the code as well??

thx once again.
 

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
Do you know how to record the macro?

1) go to Tools -> macro -> Record new macro??
2) stop when you finish.

You can see the code generated automatically in the VBE window with in new module.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,167
Messages
5,570,640
Members
412,334
Latest member
ExcelForLifeDontHate
Top