Good morning people, if anybody can help,
Is it possible with VB in excel to search a folder to find all files with .xls extentions and remove the extenion to nothing. (book1.xls to book1.)
Good morning people, if anybody can help,
Is it possible with VB in excel to search a folder to find all files with .xls extentions and remove the extenion to nothing. (book1.xls to book1.)
This one should to it, it looks for .xls and simply takes the filename up to the .:
Option Explicit Sub ChangeExt() Dim strPath$, strFile$, iPos% ' Change this, don't forget the trailing \ strPath = "e:\test\xls\" strFile = Dir(strPath & "*.xls") Do While strFile <> "" Debug.Print strPath & strFile iPos = InStr(strFile, ".xls") Name strPath & strFile As strPath & Left(strFile, iPos) strFile = Dir Loop End Sub
Daniel
Works perfectly, thank you so much
No problem, and be sure to mark this thread as solved if it is. To do that, have a look at the top of your first post, there you should see a dropdown menu "ThreadTools" where you can mark this thread solved.
Daniel
Thanks, Steiner.
I have looking for these code for long.