![]() |
Need To save a spreadsheet multiple times through a macro
I have a macros that let me update information for multiple companies. I want to add to it to save the spredsheet each time a new company is updated with information. The following macro updates the information and then prints. I want it to then save the spreadsheet after each print. How can I do this. _See_the_following_macro:_ Sub Agency() ' ' Agency Macro ' Macro recorded 3/14/2006 by Interpublic User ' ' For i = 5 To 134 Range("E8").Select Sheets("Agency List").Select Application.Run "OnSheetChange" Range("A" & i).Select Selection.Copy Sheets("Balance Sheet").Select Application.Run "OnSheetChange" Range("E8").Select ActiveSheet.Paste Application.CutCopyMode = False Selection.AutoFilter Field:=1, Criteria1:="2" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Next i End Sub -- mibsaweiss ------------------------------------------------------------------------ mibsaweiss's Profile: http://www.excelforum.com/member.php...o&userid=32533 View this thread: http://www.excelforum.com/showthread...hreadid=533944 |
Need To save a spreadsheet multiple times through a macro
Try activeworkbook.save
"mibsaweiss" wrote in message ... I have a macros that let me update information for multiple companies. I want to add to it to save the spredsheet each time a new company is updated with information. The following macro updates the information and then prints. I want it to then save the spreadsheet after each print. How can I do this. _See_the_following_macro:_ Sub Agency() ' ' Agency Macro ' Macro recorded 3/14/2006 by Interpublic User ' ' For i = 5 To 134 Range("E8").Select Sheets("Agency List").Select Application.Run "OnSheetChange" Range("A" & i).Select Selection.Copy Sheets("Balance Sheet").Select Application.Run "OnSheetChange" Range("E8").Select ActiveSheet.Paste Application.CutCopyMode = False Selection.AutoFilter Field:=1, Criteria1:="2" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Next i End Sub -- mibsaweiss ------------------------------------------------------------------------ mibsaweiss's Profile: http://www.excelforum.com/member.php...o&userid=32533 View this thread: http://www.excelforum.com/showthread...hreadid=533944 |
Need To save a spreadsheet multiple times through a macro
Activeworkbook.save would save the file over the same file. I want to save each file with a different file name. I want to choose a specific cell that each time the file refreshes with new information that cell would be the new filename. Thanks. -- mibsaweiss ------------------------------------------------------------------------ mibsaweiss's Profile: http://www.excelforum.com/member.php...o&userid=32533 View this thread: http://www.excelforum.com/showthread...hreadid=533944 |
All times are GMT +1. The time now is 10:46 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com