#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Apply macro

Hi All,

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

Thanks & Regards

Hassan
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro apply to all worksheet AskExcel Excel Worksheet Functions 3 April 1st 09 03:30 PM
Apply Macro to all worksheets in a workbook except one Carrie_Loos via OfficeKB.com Excel Discussion (Misc queries) 5 January 15th 09 10:03 PM
Apply macro to one sheet only Marcus Analyst Excel Discussion (Misc queries) 9 January 3rd 08 10:14 PM
Apply a Macro to a FunctionKey... doo[_2_] Excel Programming 1 July 7th 04 05:43 PM
Macro or VB to apply filter in spreadsheet Stevie[_3_] Excel Programming 2 February 18th 04 03:15 PM


All times are GMT +1. The time now is 08:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"