Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 72
Default copying modules from one workbook to another workbook

I'm having 2 workbooks. I wanted to copy some of the modules from workbook1
to workbook2.

Note: Both workbooks are opend.

Please help me out by providing relavent VBA code.

Advanced Thanks,
Vinod
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default copying modules from one workbook to another workbook

Why can't you just use copy and paste?

Pete

On Sep 18, 6:21*pm, Vinod wrote:
I'm having 2 workbooks. I wanted to copy some of the modules from workbook1
to workbook2.

Note: Both workbooks are opend.

Please help me out by providing relavent VBA code.

Advanced Thanks,
Vinod


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default copying modules from one workbook to another workbook

Right-click on a module in book1 and Export as a *.bas file.

In book2 right-click on a module and Import File

Do this a few times and you've got the modules copied.

To do it programmatically see Chip Pearson's site

http://www.cpearson.com/excel/VBE.aspx

Copy A Module From One Project To Another


Gord Dibben MS Excel MVP

On Thu, 18 Sep 2008 10:21:02 -0700, Vinod
wrote:

I'm having 2 workbooks. I wanted to copy some of the modules from workbook1
to workbook2.

Note: Both workbooks are opend.

Please help me out by providing relavent VBA code.

Advanced Thanks,
Vinod


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 72
Default copying modules from one workbook to another workbook

Thanks Gord Dibben.

I captured code from provided link and I achieved it partly which is failing
in saving file after copying code from a module to 'Thisworkbook' and deleted
unnecessary modules.

At the end of copy and delete process I've wrorte like this: thisworkbook.save
while executing 'save' statement I got a message saying that 'Document not
save' with 'Ok' option.

Is there any workaround for this.
Please share your thoughts and relavent code which will be appreciated.

Advanced Thanks,
Vinod


"Gord Dibben" wrote:

Right-click on a module in book1 and Export as a *.bas file.

In book2 right-click on a module and Import File

Do this a few times and you've got the modules copied.

To do it programmatically see Chip Pearson's site

http://www.cpearson.com/excel/VBE.aspx

Copy A Module From One Project To Another


Gord Dibben MS Excel MVP

On Thu, 18 Sep 2008 10:21:02 -0700, Vinod
wrote:

I'm having 2 workbooks. I wanted to copy some of the modules from workbook1
to workbook2.

Note: Both workbooks are opend.

Please help me out by providing relavent VBA code.

Advanced Thanks,
Vinod



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
Copying data from one workbook to another Amber T New Users to Excel 1 June 19th 08 06:53 PM
Copying Formulas from Workbook to Workbook Rupert[_2_] Excel Discussion (Misc queries) 3 June 4th 07 03:44 PM
Copying A Worksheet From Each Open Workbook to an new Workbook carl Excel Worksheet Functions 1 January 3rd 06 05:37 PM
Copying charts from workbook to workbook Geoff C Charts and Charting in Excel 2 March 13th 05 05:04 AM
Copying From workbook to workbook Debbie Excel Worksheet Functions 9 January 31st 05 11:39 PM


All times are GMT +1. The time now is 08:56 PM.

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

About Us

"It's about Microsoft Excel"