+ Reply to Thread
Results 1 to 3 of 3

Copy Cell Range From Previous Sheet and Paste to Active Sheet

  1. #1
    Registered User
    Join Date
    08-02-2013
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2010
    Posts
    28

    Copy Cell Range From Previous Sheet and Paste to Active Sheet

    I am trying to create a macro to copy and paste a range of cells from the previous sheet (i've been using ActiveSheet.Previous.Select) to the sheet that I ran the macro on only (I've been using ActiveSheet.Select). The active sheet is a copy of the previous sheet with a different name (names are Fri, Sat, Sun, etc. and are formatted exactly the same).

    The ranges that I would like to copy is: M61:M84, N61:O84 (merged columns), P61:T84, and R85:R86 (merged rows)

    Here is the code I currently have, but it is not working as I had hoped.

    Sub copy_vessel_personnel()

    'freezes screen
    ScreenUpdating = False

    ' copy vessel personnel from prior sheet

    ActiveSheet.Previous.Select
    Range("M61:M84").Select
    Selection.Copy
    ActiveSheet.Select
    Range("M61:M84").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    ActiveSheet.Previous.Select
    Range("N61:O84").Select
    Application.CutCopyMode = False
    Selection.Copy
    ActiveSheet.Select
    Range("N61:O84").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    ActiveSheet.Previous.Select
    Range("P61:T84").Select
    Application.CutCopyMode = False
    Selection.Copy
    ActiveSheet.Select
    Range("P61:T84").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    ActiveSheet.Previous.Select
    Range("R85:R86").Select
    Application.CutCopyMode = False
    Selection.Copy
    ActiveSheet.Select
    Range("R85:R86").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    End Sub




    Thanks,
    Jordan

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Copy Cell Range From Previous Sheet and Paste to Active Sheet

    Hi, jtal,

    you should wrap up your procedure in code-tags.

    Maybe the following code may be good enough:

    Please Login or Register  to view this content.
    You should avoid using MergedCells - no matter what you think about how important they seem to be to you.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    08-02-2013
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Copy Cell Range From Previous Sheet and Paste to Active Sheet

    Holger,

    That worked great, thanks for you help.

    - Jordan

+ 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] Copy & Paste active row to Sheet 2 without cell borders
    By XxCMoneyxX in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2013, 11:10 AM
  2. Replies: 1
    Last Post: 01-07-2013, 12:23 AM
  3. Copy dynamic range from previous sheet and paste after last used row in a range
    By Mistweaver in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-04-2010, 06:24 PM
  4. [SOLVED] Active Cell Copy And Paste Sheet to Sheet
    By A.R.J Allan Jefferys in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 05-03-2006, 09:10 PM
  5. Copy from active sheet and paste into new sheet using info from cell in active
    By Ingve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2006, 06:00 PM

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