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

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
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....
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,390
Members
448,957
Latest member
Hat4Life

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