ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save all files opened (https://www.excelbanter.com/excel-programming/384709-save-all-files-opened.html)

Carpe Diem

Save all files opened
 
Hi,

I usually use about 15 files at the same time and I would like to
arrange a way to save all files at once instead of save the files one
by one.

Anyone knows a add in or a macro that could do this ?

Thank you

Ricardo


joel

Save all files opened
 

I found this example in the VBA help (see below) I would think this would
work
Set fc = f.Files
For Each f1 in fc
f1.close
Next



Sub ShowFolderList(folderspec)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name
s = s & vbCrLf
Next
MsgBox s
End Sub


"Carpe Diem" wrote:

Hi,

I usually use about 15 files at the same time and I would like to
arrange a way to save all files at once instead of save the files one
by one.

Anyone knows a add in or a macro that could do this ?

Thank you

Ricardo



Carpe Diem

Save all files opened
 
Thank you for your help, I will try
Joel wrote:
I found this example in the VBA help (see below) I would think this would
work
Set fc = f.Files
For Each f1 in fc
f1.close
Next



Sub ShowFolderList(folderspec)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name
s = s & vbCrLf
Next
MsgBox s
End Sub


"Carpe Diem" wrote:

Hi,

I usually use about 15 files at the same time and I would like to
arrange a way to save all files at once instead of save the files one
by one.

Anyone knows a add in or a macro that could do this ?

Thank you

Ricardo




NickHK

Save all files opened
 
Ricardo,
I assume you mean open Excel files in you instance of Excel:


Private Sub CommandButton1_Click()
Dim WB As Workbook

For Each WB In Workbooks
'Avoid hidden WBs, e.g. Personal.xls etc
If WB.Windows(1).Visible = True Then
WB.Save
End If
Next

End Sub

NickHK

"Carpe Diem" wrote in message
oups.com...
Hi,

I usually use about 15 files at the same time and I would like to
arrange a way to save all files at once instead of save the files one
by one.

Anyone knows a add in or a macro that could do this ?

Thank you

Ricardo





All times are GMT +1. The time now is 08:04 AM.

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