populate unique entries to txt file

  • Thread starter Thread starter ymeyaw
  • Start date Start date
Y

ymeyaw

dear all,
I am new to VBA and i am currently need to have a macros to populat
unique entries into an txt file.

Spreasheet (A1 column)
-----------
aaaaa_1
aaaaa_2
bbbbb_1
ccccc_3
ccccc_1

i wish to populate the above datas into a txt file with this result:

result.txt
--------
aaaaa
bbbbb
ccccc

Can anyone help on this
 
maybe it is a lot easier to transfer the data to ACCESS, strip it,
group it and export it.

Good luck,
Peter
 
hi,
basically i had few funtions in VBA excel. This is just part of
functions of my VBA.That's why i need to do this in excel. :(
 
I'd try this manually to see if it worked. Then if it did, record a macro when
I did it for real.

copy column A to a worksheet in a new workbook
Add a header row to A1 of that new worksheet
select column A
edit|replace
what: _* (underscore, asterisk)
with: (leave blank)
replace all

Then use data|filter|advanced filter to extract the unique values into column B.
Delete column A
delete the header in A1 (it moved from B1 when column A was deleted
Sort that column (if you want)

Save that file as .txt
close without saving

Open the file in NotePad to see if it worked ok.

Debra Dalgleish shows how to extract those unique values manually:
http://www.contextures.com/xladvfilter01.html#FilterUR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top