Welcome Guest ( Log In | Click here to Register a free account now! )
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.![]() ![]() |
Apr 30 2008, 09:33 PM
Post
#1
|
|
|
New Member ![]() Group: Members Posts: 4 Joined: 11-May 07 Member No.: 130,321 |
Thank you This post has been edited by IrishLefty: Apr 30 2008, 09:33 PM |
|
|
|
May 12 2008, 02:05 AM
Post
#2
|
|
|
Member ![]() ![]() Group: Members Posts: 20 Joined: 8-January 06 Member No.: 49,633 |
Try this code:
Sub main() fileI = ActiveSheet.Cells(1, 1).Value FileN = fileI + ".xlsm" ActiveWorkbook.SaveAs Filename:=FileN, FileFormat:=52 End Sub Filefomat = 52 means file type is Open XML Workbook Macro Enabled. Excel2007 wont let you save the workbook in any other fomat since it contain a macro. About the button part, I would suggest having a keyboard shortcut when you write this macro.e.g if Ctrl+T is your shortcut, once you type Ctrl T, the current workbook will be saved to A1value.xlsm. If you also want to close the file as soon as you save, add one more line to the code activeworkbook.close savechanges:= true Hope this helps. |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 20th July 2008 - 08:47 AM |