PDA

View Full Version : Is it possible to automatically removes spaces, commas, and delimiters using VBA?



wedd
02-15-2012, 07:09 AM
Hi experts,

Is it possible to automatically removes spaces, commas, and delimiters using visual basic code when data from a txt files, csv.files etc has been imported into Excel?
Once that is done I will like to devise a system for importing and reconfiguring the data automatically or semi-automatically (people running macros for example). Can this be done, if so how? Would you have any examples of code, strategies you may worked on in a similar project or websites? I am a beginner/intermediate user of visual basic, so the sources or information you display to me will be very useful...:friends:

Thanks for your contributions :friends:

Jan Karel Pieterse
02-15-2012, 07:37 AM
I like my own article on importing text files as a start, although it doesn't answer your question:
www.jkp-ads.com/articles/importtext.asp (http://www.jkp-ads.com/articles/importtext.asp)
For the cleansing of the data, why not record a macro while performing some of the steps, e.g. doing a search and replace to replace double spaces. It should get you a head start?

Kenneth Hobs
02-15-2012, 09:08 AM
It is best to work up short example files to get the best help. There are many ways to do it. Most want the delimiters for various import methods.