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:
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,053
Messages
5,835,149
Members
430,342
Latest member
Sailingexcel

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