Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Saving Vba Code
Ok I know this sounds pretty silly, but. How do you save VBA code. spent all
of yesturday putting down loads of code, saved the work book and closed down, came back to it this morning and nothing! lost the lot. As you can imagine, not a happy teddy bear! |
#2
|
|||
|
|||
Rick,
Your code, whether you write it yourself in the VBE, or record it with the macro recorder, goes into modules kept in a workbook. In the VBE, the Project Explorer (a pane usually open at left), which is in outline format, lets you open various modules. Open any workbooks you'd have had open. Then go to the VBE (Alt-F11). If there's no Project Explorer, do View - Project Explorer. Each open workbook is a project, and if there's a Personal.xls workbook (which can also contain macros), you can open the modules of that too. The projects may be collapsed (there'll be a +, click it to expand). Double-click each module, hoping you'll find the one that has your code. -- Earl Kiosterud www.smokeylake.com "Rick, United Kingdom" wrote in message ... Ok I know this sounds pretty silly, but. How do you save VBA code. spent all of yesturday putting down loads of code, saved the work book and closed down, came back to it this morning and nothing! lost the lot. As you can imagine, not a happy teddy bear! |
#3
|
|||
|
|||
VBA code is always stored in the workbook, so if you save the
workbook it should save the code. It could be the case that your workbook is corrupted, making the VBA unreadable. Unfortunately, there is nothing you can do about it. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Rick, United Kingdom" wrote in message ... Ok I know this sounds pretty silly, but. How do you save VBA code. spent all of yesturday putting down loads of code, saved the work book and closed down, came back to it this morning and nothing! lost the lot. As you can imagine, not a happy teddy bear! |
#4
|
|||
|
|||
If however you recall a message coming up when you closed Excel saying 'You
have made changes to your Personal macro Workbook - Do you wish to save those changes" and you hit no, then that is likely where the code went and is now lost. -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ------------------------------*------------------------------*---------------- It's easier to beg forgiveness than ask permission :-) ------------------------------*------------------------------*---------------- "Earl Kiosterud" wrote in message ... Rick, Your code, whether you write it yourself in the VBE, or record it with the macro recorder, goes into modules kept in a workbook. In the VBE, the Project Explorer (a pane usually open at left), which is in outline format, lets you open various modules. Open any workbooks you'd have had open. Then go to the VBE (Alt-F11). If there's no Project Explorer, do View - Project Explorer. Each open workbook is a project, and if there's a Personal.xls workbook (which can also contain macros), you can open the modules of that too. The projects may be collapsed (there'll be a +, click it to expand). Double-click each module, hoping you'll find the one that has your code. -- Earl Kiosterud www.smokeylake.com "Rick, United Kingdom" wrote in message ... Ok I know this sounds pretty silly, but. How do you save VBA code. spent all of yesturday putting down loads of code, saved the work book and closed down, came back to it this morning and nothing! lost the lot. As you can imagine, not a happy teddy bear! |
#5
|
|||
|
|||
Ken,
Yeah. That's absolutely right. I meant to mention that any workbooks containing macro code would have to be saved. Take heart, Rick. It never takes as long the second time. -- Earl Kiosterud www.smokeylake.com "Ken Wright" wrote in message ... If however you recall a message coming up when you closed Excel saying 'You have made changes to your Personal macro Workbook - Do you wish to save those changes" and you hit no, then that is likely where the code went and is now lost. -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ------------------------------*------------------------------*---------------- It's easier to beg forgiveness than ask permission :-) ------------------------------*------------------------------*---------------- "Earl Kiosterud" wrote in message ... Rick, Your code, whether you write it yourself in the VBE, or record it with the macro recorder, goes into modules kept in a workbook. In the VBE, the Project Explorer (a pane usually open at left), which is in outline format, lets you open various modules. Open any workbooks you'd have had open. Then go to the VBE (Alt-F11). If there's no Project Explorer, do View - Project Explorer. Each open workbook is a project, and if there's a Personal.xls workbook (which can also contain macros), you can open the modules of that too. The projects may be collapsed (there'll be a +, click it to expand). Double-click each module, hoping you'll find the one that has your code. -- Earl Kiosterud www.smokeylake.com "Rick, United Kingdom" wrote in message ... Ok I know this sounds pretty silly, but. How do you save VBA code. spent all of yesturday putting down loads of code, saved the work book and closed down, came back to it this morning and nothing! lost the lot. As you can imagine, not a happy teddy bear! |
#6
|
|||
|
|||
Thanks Earl I just finished rewriting the code (in the evenings) anywya i
think i figured out what went wrong. the original workbook was built on excel 2000. And the code was wriitten after i upgraded to 2003. so i am guessing that the upgrade either corrupted the file or some pesky gremlins got in the works! any way rebuilt the enitire work book and it save vba code fine! Yippee! thanks again "Earl Kiosterud" wrote: Ken, Yeah. That's absolutely right. I meant to mention that any workbooks containing macro code would have to be saved. Take heart, Rick. It never takes as long the second time. -- Earl Kiosterud www.smokeylake.com "Ken Wright" wrote in message ... If however you recall a message coming up when you closed Excel saying 'You have made changes to your Personal macro Workbook - Do you wish to save those changes" and you hit no, then that is likely where the code went and is now lost. -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ------------------------------Â*------------------------------Â*---------------- It's easier to beg forgiveness than ask permission :-) ------------------------------Â*------------------------------Â*---------------- "Earl Kiosterud" wrote in message ... Rick, Your code, whether you write it yourself in the VBE, or record it with the macro recorder, goes into modules kept in a workbook. In the VBE, the Project Explorer (a pane usually open at left), which is in outline format, lets you open various modules. Open any workbooks you'd have had open. Then go to the VBE (Alt-F11). If there's no Project Explorer, do View - Project Explorer. Each open workbook is a project, and if there's a Personal.xls workbook (which can also contain macros), you can open the modules of that too. The projects may be collapsed (there'll be a +, click it to expand). Double-click each module, hoping you'll find the one that has your code. -- Earl Kiosterud www.smokeylake.com "Rick, United Kingdom" wrote in message ... Ok I know this sounds pretty silly, but. How do you save VBA code. spent all of yesturday putting down loads of code, saved the work book and closed down, came back to it this morning and nothing! lost the lot. As you can imagine, not a happy teddy bear! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change case...help please | Excel Worksheet Functions | |||
Macro for changing text to Proper Case | Excel Worksheet Functions | |||
Using other workbooks.. | Excel Worksheet Functions | |||
Make Change Case in Excel a format rather than formula | Excel Worksheet Functions | |||
How do I retain leading zero zip code formatting when saving as a. | Excel Discussion (Misc queries) |