#1   Report Post  
Rick, United Kingdom
 
Posts: n/a
Default 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   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

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   Report Post  
Chip Pearson
 
Posts: n/a
Default

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   Report Post  
Ken Wright
 
Posts: n/a
Default

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   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

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   Report Post  
Rick, United Kingdom
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change case...help please Terry Excel Worksheet Functions 14 October 2nd 05 12:29 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Using other workbooks.. DavidMunday Excel Worksheet Functions 2 July 1st 05 07:35 AM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM
How do I retain leading zero zip code formatting when saving as a. RodFCIS Excel Discussion (Misc queries) 7 January 25th 05 07:29 PM


All times are GMT +1. The time now is 02:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"