EXCEL VBA: Application.FileSearch Error in Running Excel 2013
Solved/Closed
g.cabal
TrowaD
- Posts
- 3
- Registration date
- Thursday June 16, 2016
- Status
- Member
- Last seen
- June 17, 2016
TrowaD
- Posts
- 2886
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- June 27, 2022
Related:
- Application.filesearch not working
- Vba application.filesearch - Best answers
- With application.filesearch - Best answers
- Excel VBA: Application.FileSearch Error ✓ - Forum - Excel
- Youtube application download for pc - Download
- Jpg application download - Download
- Netflix application for pc - Download
- Install application from tar.gz ubuntu - Guide
2 replies
TrowaD
Jun 16, 2016 at 11:07 AM
- Posts
- 2886
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- June 27, 2022
Jun 16, 2016 at 11:07 AM
Hi G.Cabal,
I have no experience with FileSearch, but it seems to be replaced by FindFile in later excel versions.
May the 3rd reply in the link below further guide you:
https://www.mrexcel.com/board/threads/excel-2010-vba-replacement-for-application-filesearch.643288/
Good luck and best regards,
Trowa
I have no experience with FileSearch, but it seems to be replaced by FindFile in later excel versions.
May the 3rd reply in the link below further guide you:
https://www.mrexcel.com/board/threads/excel-2010-vba-replacement-for-application-filesearch.643288/
Good luck and best regards,
Trowa
TrowaD
Jun 28, 2016 at 12:00 PM
- Posts
- 2886
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- June 27, 2022
Jun 28, 2016 at 12:00 PM
Hi Giezel,
Try the code below and see if it yields the desired results.
Enter folder path on code line 8.
Data from .txt files will be pasted in column A of the active sheet.
Best regards,
Trowa
Monday, Tuesday and Thursday are usually the days I'll respond. Bear this in mind when awaiting a reply.
Try the code below and see if it yields the desired results.
Enter folder path on code line 8.
Data from .txt files will be pasted in column A of the active sheet.
Sub OpenFiles() Dim MyFolder As String Dim MyFile As String Dim Filename As String Dim cRow As Integer MyFolder = "Folder path here" MyFile = Dir(MyFolder & "\*.txt") cRow = 2 Do While MyFile <> "" Filename = MyFolder & "\" & MyFile Open Filename For Input As #1 Do Until EOF(1) Line Input #1, textline If textline <> vbNullString Then ActiveSheet.Range("A" & cRow).Value = textline End If cRow = cRow + 1 Loop Close #1 MyFile = Dir() Loop End Sub
Best regards,
Trowa
Monday, Tuesday and Thursday are usually the days I'll respond. Bear this in mind when awaiting a reply.
Jun 17, 2016 at 07:03 AM
Jun 17, 2016 at 07:09 AM
I already resolved the .FileSearch but my problem is the replace of the code below:
For i = 1 To Application.SelectedItems.Count
Call ReadData(.SelectedItems(i), DataCol)
DataCol = DataCol + 1
Sheets(DataSheet).Select
Next i
Thanks.
Jun 20, 2016 at 11:56 AM
What are you trying to achieve with that piece of code?
Best regards,
Trowa
Jun 22, 2016 at 04:49 AM
Sorry for late reply.
If .txt file/s are found the content of all text files will copied to the sheet in new sheet name