That's great but how would I sequentially open the files then perform the
code then close the file
"Ben" wrote:
>
>
> "AA2e72E" wrote:
>
> > This code will give you a starting point:
> >
> > Sub aa()
> > Set fso =
> > CreateObject("Scripting.FileSystemObject").GetFolder("c:\OurFiles\")
> > For Each file In fso.Files
> > If file.Type = "Microsoft Excel Worksheet" Then
> > With file
> > ' do what you want with this file
> > End With
> > End If
> > Next
> > Set fso = Nothing
> > End Sub
> >
> > Note: Replace "C:\OURFILES" by your folder; this code does not recurse the
> > foldre tree if it has one.
> >
> > "Ben" wrote:
> >
> > > I would like to perform a piece of code on every workbook in a folder and
> > > then close it. What would be the best way please. Thank you
Bookmarks