+ Reply to Thread
Results 1 to 10 of 10

Using a macro to add code to a newly created workbook.

  1. #1
    Registered User
    Join Date
    12-03-2010
    Location
    Minnesota
    MS-Off Ver
    Excel 2003
    Posts
    16

    Using a macro to add code to a newly created workbook.

    I am using the macro below. It is working great to add data and formulas to the new sheet, however I want to add another feature to this tlmsbiwk.xls file.

    Please Login or Register  to view this content.
    What I want to add is the code below. I just want it to be included in the new .xls file that is created. I now add it manually and it works fine, I would like to have it included in this step automatically. Thanks for your help.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Using a macro to add code to a newly created workbook.

    You could try having the extra code in a workbook that you use as a template and copy the contents of your text file into it.
    Martin

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Using a macro to add code to a newly created workbook.

    Hi Alagard

    Try this
    Please Login or Register  to view this content.
    Place the code in a general Module of Book 1. It'll write the code in Sheet 1 module of Book 2.

    John
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Using a macro to add code to a newly created workbook.

    Alagard

    Have you bothered to read the Forum Rules? You have posted this question 3 times

    http://www.excelforum.com/excel-prog...-workbook.html

    http://www.excelforum.com/excel-prog...g-a-macro.html

    You haven't even replied to any of them!!!!

    Read the Forum Rules then PM me that you intend following them, otherwise I will remove your posting rights.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    12-03-2010
    Location
    Minnesota
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Using a macro to add code to a newly created workbook.

    I tried using this and while it did not break anything it also did not add the code into the newly created workbook. Thanks.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Using a macro to add code to a newly created workbook.

    Hi Alagard

    I'll be glad to follow up on this. However, until this is resolved
    Read the Forum Rules then PM me that you intend following them, otherwise I will remove your posting rights.
    you're under somewhat of a quarantine.

    RoyUK...has this issue been resolved?

    John

  7. #7
    Registered User
    Join Date
    12-03-2010
    Location
    Minnesota
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Using a macro to add code to a newly created workbook.

    I think it has been taken care of. However if it hasn't I am working on another solution as well if that works I will post it here also. Thanks for your help. Also if it helps I am doing all of this with files on a shared network drive.

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Using a macro to add code to a newly created workbook.

    Please Login or Register  to view this content.
    Last edited by snb; 12-16-2010 at 05:11 PM.



  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Using a macro to add code to a newly created workbook.

    I've had a reply, but you haven't given me any good reason why you double posted. It's clearly stated in the rules not to double post.

    I don't consider your response to even accept the reason for not double posting.

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Using a macro to add code to a newly created workbook.

    Hi royUK

    I'll wait to post until the issue is resolved.

    John

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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