+ Reply to Thread
Results 1 to 3 of 3

Copy/Paste Macro

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-25-2007
    Posts
    166

    Copy/Paste Macro

    Please see the attached file for clarification:

    Attachment 11707

    This is a very abbreviated version of my actual worksheet. There are 100+ tasks (sections), and I would like to include a command button at the top with a macro that will insert a new task (or section) wherever the user wants in the worksheet (i.e., between 2 and 3, or between 3 and 4, etc).

    Currently the code I have set up - which I copied and unsuccessfully modified from another source - is:
     Private Sub CommandButton1_Click()
        Range("B71:M77").Select
        Selection.Copy
        ActiveCell.Insert Shift:=xlDown
        Application.CutCopyMode = False
        ActiveCell.FormulaR1C1 = ""
    End Sub
    The problem I'm having is getting the macro to paste the template from below back up top, wherever the user has initially selected a cell.

    Any help is greatly appreciated! Thanks.
    Last edited by VBA Noob; 06-26-2007 at 05:30 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Your download isn't working so I'm not completely sure what you are doing. Try this, enter the range that you are copying

      ActiveCell.Insert Shift:=xlDown
        Range("your formulas").Copy ActiveCell
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    06-25-2007
    Posts
    166
    copy_paste.zip

    Hopefully that works a little better? Please take a look and see if you might be able to help! Thanks...

+ 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