ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Apply macro (https://www.excelbanter.com/excel-programming/397956-apply-macro.html)

Hassan

Apply macro
 
Hi All,

Is it possible to apply macro on every file in specified folder?

Thanks & Regards

Hassan

No Name

Apply macro
 
Yes it is.

"Hassan" az alábbiakat Ã*rta a következÅ‘ hÃ*rüzenetben: ...
Hi All,

Is it possible to apply macro on every file in specified folder?

Thanks & Regards

Hassan


joel

Apply macro
 
Here is an example

Sub opendir()

Dim FileSize As Long
Mydir = "c:\temp"

RowCount = 1
First = True
Do

If First = True Then
Myfilename = Dir(Mydir & "\*.xls")
First = False
Else
Myfilename = Dir
End If

If Myfilename < "" Then
Workbooks.Open (Mydir & "\" & Myfilename)

'enter you code here

Workbooks(Myfilename).Close

End If
Loop While Myfilename < ""

End Sub


"tomi12619" wrote:

Yes it is.

"Hassan" az alábbiakat Ã*rta a következÅ‘ hÃ*rüzenetben: ...
Hi All,

Is it possible to apply macro on every file in specified folder?

Thanks & Regards

Hassan




All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com