+ Reply to Thread
Results 1 to 4 of 4

Macro to copy and paste information into new sheets.

  1. #1
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Macro to copy and paste information into new sheets.

    Hi,

    The problem i have is this. I have button operated macros on the same sheet (MODULE) which allows the user to:

    a) Create a direct copy of the existing MODULE sheet and open it into a new sheet.

    b) Copy a named range (peoples names) from the MODULE sheet into another pre-created sheet called ARCHIVE.
    Also, on the pre-created sheet called ARCHIVE, I have a macro that allows the user to:

    a) Create a direct copy of the ARCHIVE sheet and open it into a new sheet.
    All these work fine. The issue arises once the user tries to copy names from a newly created MODULE sheet into a newly created ARCHIVE sheet as it copies the information back into the original ARCHIVE and not into the new one. How can I make sure it copies the names into the new sheet rather than the old one?

    I'd also say i created these by simply recording the actions rather than coding them, which might be part of the problem....

    Hope this makes some sort of sense...

    Thanks
    Last edited by Barking_Mad; 09-22-2009 at 08:54 AM.

  2. #2
    Forum Contributor
    Join Date
    11-26-2008
    Location
    UK
    MS-Off Ver
    Using Excel 2019
    Posts
    317

    Re: Macro to copy and paste information into new sheets.

    This is the current code

    Sub CopyNames()
    '
    ' CopyNames Macro
    ' copies names over to archive
    '
    ' Keyboard Shortcut: Ctrl+n
    '
    Application.Goto Reference:="namesrange"
    Selection.Copy
    Sheets("Archive | ").Select
    Range("A13").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    End Sub

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macro to copy and paste information into new sheets.

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    In this instance I suspect we need the file with all VBA present

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

    Re: Macro to copy and paste information into new sheets.

    Also, please use Code Tags not Quote tags around your code.
    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