Excel VBA - How to Loop Through Files in Folder

preview_player
Показать описание
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
Рекомендации по теме
Комментарии
Автор

thx.. needed a quick refresher.. you rock!

wizdumb
Автор

You are pretty good at explaining, thanks!

raiqessani
Автор

Hi..

How do we send separate auto emails attaching each of these files from a folder and each file will needs to be sent to different email id.?

AmitSharma-pozb