View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
tony h[_55_] tony h[_55_] is offline
external usenet poster
 
Posts: 1
Default Perform action on every workbook in a directory


Sub a()
Dim wkb As Workbook
Dim strPath As String
Dim strFile As String

strPath = "C:\myfiles\" your path
strFile = Dir(strPath & "*.xls")
Do While strFile < ""
Set wkb = Workbooks.Open(strPath & strFile)
'do your bits
wkb.Close savechanges:=True
strFile = Dir()
Loop
MsgBox "done"
End Sub

regards


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=509000