Excel VBA - How to Loop Through Files in Folder

Published: 04 December 2014
on channel: InAnOffice
21,410
120

Excel VBA Learn how to loop through files in a specific folder

The code used in this video:

Sub GetFiles()
Dim file As String
file = Dir("C:\Reports\*.xl??")

Dim row As Integer
row = 1

Do While file ""

Cells(row, 1) = file

row = row + 1
file = Dir()

Loop

End Sub


Watch video Excel VBA - How to Loop Through Files in Folder online without registration, duration hours minute second in high quality. This video was added by user InAnOffice 04 December 2014, don't forget to share it with your friends and acquaintances, it has been viewed on our site 21,410 once and liked it 120 people.