+ Reply to Thread
Results 1 to 6 of 6

How can I transfer "Macro1" from under Module1 to under Sheet1 ?

Hybrid View

  1. #1
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,014

    How can I transfer "Macro1" from under Module1 to under Sheet1 ?

    Greetings,

    I have a code named "Macro1" under Module1.
    How can I transfer "Macro1" to under Sheet1 via vba code?

    or,

    I have a code named "Macro1" under Sheet1.
    How can I transfer "Macro1" to under Sheet2 via vba code?

    Regards.
    Last edited by HerryMarkowitz; 08-11-2014 at 06:53 PM.
    Sub DontForgetThese()
         If Your thread includes any code Then Please use code tags...
         If Your thread has been solved Then Please mark as solved...
         If Anybody has helped to you Then Please add reputation...
    End Sub

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: How can I transfer "Macro1" from under Module1 to under Sheet1 ?

    http://www.cpearson.com/excel/vbe.aspx
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,481

    Re: How can I transfer "Macro1" from under Module1 to under Sheet1 ?

    Just copy and paste it, or cut and paste it.

    But the Sheet Class Module should only have Event code and code that is specific to that sheet, for example, called by an Event Handler.

    Normal/generic code should be in a Standard/Normal module.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,481

    Re: How can I transfer "Macro1" from under Module1 to under Sheet1 ?

    I take it your question has been answered?

  5. #5
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,014

    Re: How can I transfer "Macro1" from under Module1 to under Sheet1 ?

    I found the answer from following link.
    http://www.cpearson.com/excel/vbe.aspx
    Thanks everybody.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,481

    Re: How can I transfer "Macro1" from under Module1 to under Sheet1 ?

    Ah, ok. Missed the "via vba code" bit, even though you said it twice.

    Good reference though

    Regards, and thanks for the rep, TMS

+ 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] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  2. [SOLVED] explain formula =IF(F85="",10,MODULE1.QUALSCORE(F85,1,0,10))
    By rohit43 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-08-2012, 04:42 PM
  3. Replies: 2
    Last Post: 05-05-2008, 04:51 PM
  4. "Compile error in hidden module: module1"
    By jonn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-10-2008, 08:14 AM
  5. use variable in Workbooks("book1").Worksheets("sheet1").Range("a1"
    By Luc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-28-2005, 04:05 PM

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