+ Reply to Thread
Results 1 to 5 of 5

Copy/read lines of code in sheet module

  1. #1
    Registered User
    Join Date
    03-26-2014
    Location
    Norway
    MS-Off Ver
    Microsoft 365 MSO (Version 2403 Build 16.0.17425.20124) 64-bit
    Posts
    33

    Copy/read lines of code in sheet module

    I want to copy/read code in a sheet module, and use the code inside the code in a code module?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy/read lines of code in sheet module

    From a design aspect, it would be better to create "sub routines" stored in Code Modules and available to be called and used by all your other macros, regardless of where they are.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-26-2014
    Location
    Norway
    MS-Off Ver
    Microsoft 365 MSO (Version 2403 Build 16.0.17425.20124) 64-bit
    Posts
    33

    Re: Copy/read lines of code in sheet module

    I want to use the code in '.InsertLines( line, code)'(https://msdn.microsoft.com/en-us/lib.../gg251768.aspx), because as far as I know, one cannot import code directly into sheet modules in a new workbook. So I want to have a code module that writes the code to the sheet module, in a new workbook.

  4. #4
    Registered User
    Join Date
    03-26-2014
    Location
    Norway
    MS-Off Ver
    Microsoft 365 MSO (Version 2403 Build 16.0.17425.20124) 64-bit
    Posts
    33

    Re: Copy/read lines of code in sheet module


  5. #5
    Registered User
    Join Date
    03-26-2014
    Location
    Norway
    MS-Off Ver
    Microsoft 365 MSO (Version 2403 Build 16.0.17425.20124) 64-bit
    Posts
    33

    Re: Copy/read lines of code in sheet module

    Quote Originally Posted by Woulter View Post
    That worked!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Module reveals 4 red lines of red code; what is wrong here?
    By chin67326 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2016, 01:21 PM
  2. [SOLVED] Code locks cells when inserted in sheet module but returns error in standard module
    By yoda66 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2014, 07:39 AM
  3. VBA code. Copy Excel Sheet/Range with all formats but no grid lines to a new Word document
    By Richard Buttrey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-17-2014, 08:06 PM
  4. How to copy sheet to new book without sheet module code?
    By MelinaT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2011, 11:52 AM
  5. how to access Sheet module, normal module, Worbook module to type code
    By alibaba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2009, 07:51 AM
  6. Passing variables and values between sheet code and module code
    By imux in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-14-2009, 12:23 PM
  7. Add sheet. Copy Code & Paste in new Module
    By omnibuster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2008, 03:37 AM

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