+ Reply to Thread
Results 1 to 2 of 2

Copy Sheet / Create & Name New Sheet / Insert Before a Sheet / Paste Data

  1. #1
    Registered User
    Join Date
    08-23-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    57

    Question Copy Sheet / Create & Name New Sheet / Insert Before a Sheet / Paste Data

    Sorry for the confusing title...

    I have a workbook that currently has 5 sheets.

    Sheet 1 is a summary sheet
    Sheet 2, 3 & 5 are hidden (for other purposes)
    Sheet 4 is a data sheet

    Here is what I am trying to accomplish, and please keep in mind I am not new to VBA, but I am hardly an Expert and this is something I have never tried before.

    I am trying to create a macro (started by pushing a button on Sheet1) that will do the following:

    Copy Sheet 2 (the whole sheet)
    Create a new Sheet before Sheet 5 and name it based off of Input from a Input Box
    Paste the copied data from Sheet 2 into this newly created sheet.

    This is what I currently have; however, this obviously is not working

    Please Login or Register  to view this content.
    I am returning an error on the .Worksheet portion of Excel.Worksheet

    Any help would be appreciated!
    A macro does what you tell it, not what you want.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy Sheet / Create & Name New Sheet / Insert Before a Sheet / Paste Data

    Try this code
    Please Login or Register  to view this content.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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