Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default What is the quickest way to copy codes in Sheets?



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Anson" wrote in message
...
I have wrote some codes to copy the modules and forms from the one

workbook to another. Most of them worked fine, but the sheets modules were
turned into class modules. I know I could manually enter the exact lines
from the sheets and have the macro to wirte it, but is there a way to copy?

This is the section that deals with coping modules:

'---------------------------------------------------------------------------
------
Dim NewBook As Workbook
Dim VBComponent As VBIDE.VBComponent, ModName As String

'Copy Modules
ModName = ThisWorkbook.Path & "\Merit Worksheet Code.txt"
For Each VBComponent In ThisWorkbook.VBProject.VBComponents

VBComponent.Export ModName
NewBook.VBProject.VBComponents.Import ModName
Kill ModName

Next VBComponent



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
copy cell info to other sheets, other sheets dont contain all row. Ja Excel Worksheet Functions 1 November 1st 09 12:53 AM
Codes needed to copy same one row from more than 300 Excel files Joe Roberto Excel Discussion (Misc queries) 1 September 25th 09 12:07 PM
IRR: is there a quickest way? l Excel Worksheet Functions 2 October 15th 06 09:08 PM
in VBA Sheets("mysheet").Copy Befo=Sheets(1) how do i get a reference to the newly created copy of this sheet? Daniel Excel Worksheet Functions 1 July 6th 05 09:57 PM
See who's quickest at solving this Bernie Deitrick Excel Programming 3 April 21st 04 12:57 PM


All times are GMT +1. The time now is 04:12 PM.

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"