+ Reply to Thread
Results 1 to 3 of 3

Add sheet. Copy Code & Paste in new Module

  1. #1
    Registered User
    Join Date
    11-07-2007
    Location
    Estonia
    MS-Off Ver
    OFF 2003 (11.8237.8221) SP3
    Posts
    16

    Add sheet. Copy Code & Paste in new Module

    How copy code in Sheet1 ... and paste to Sheet3 module?

    Sheet1 Have a macro:
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Selection.Copy
    Sheets("Sheet2").Activate
    ActiveSheet.Range("B1").Activate
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False
    AA
    End Sub

    Sub AA() ''
    Sheets.Add
    ActiveSheet.Name = "Sheet3"

    Sheet1.Select. Copy code: Private Sub Worksheet_BeforeDoubleClick(ByV... & Paste in the "Sheet3" WorkSheet_BeforeDoubleClick(B module End Sub
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Add sheet. Copy Code & Paste in new Module

    omnibuster,

    Programming The VBA Editor - Created by Chip Pearson at Pearson Software Consulting LLC
    http://www.cpearson.com/Excel/vbe.aspx

    See:
    Function CopyModule


    Have a great day,
    Stan
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

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

    You must use Code tags when posting code to the Forum, Read the Forum Rules and be sure to follow them all in future.
    Last edited by VBA Noob; 02-03-2009 at 06:05 PM.
    Hope that helps.

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

    Free DataBaseForm example

+ 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