+ Reply to Thread
Results 1 to 4 of 4

Macro through macro

  1. #1
    Registered User
    Join Date
    10-09-2012
    Location
    INDIA
    MS-Off Ver
    2010/2013
    Posts
    12

    Macro through macro

    HI there,

    I already have a macro written in Book1. The macro creates a new workbook Book2.

    I want the macro written in Book1 to write a macro inside Book2. Is there any way that is possible?

    Thanks for all your help in advance.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646
    Use a template that already has the code in it.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    10-09-2012
    Location
    INDIA
    MS-Off Ver
    2010/2013
    Posts
    12

    Re: Macro through macro

    Thank You for the reply.

    But how do i use a template on Book2 through a macro.

    I tried using the export code and import code functionality. The code gets copied to Book2 but it does not seem to work. I dont know what i might be doing wrong. Note: the code given below is written along with the main code in Book1.Module1. There is another code in Module2 which I want to be copied to Book2
    Below is the code that I have used.
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646
    I'm suggesting you don't use code to write code.

    Instead of creating a new, blank workbook create a copy of Book1 or use a template which already has the code in it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1