+ Reply to Thread
Results 1 to 4 of 4

Macro for copying from one sheet and pasting into another

  1. #1
    Registered User
    Join Date
    11-20-2019
    Location
    London
    MS-Off Ver
    Microsoft Office 365 V1910
    Posts
    81

    Macro for copying from one sheet and pasting into another

    I have a pretty basic macro that I copied of youtube to copy data from a set location in sheet 1 and paste into sheet 6

    Please Login or Register  to view this content.

    Whenever I run the code it says it is out of range
    And is it possible to add to the code to only copy the cells in that range if they have data entered in them?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro for copying from one sheet and pasting into another

    The ranges are not the same size.

    Inidentally try to get into the habit of using VBA sheet code names rather than sheet tab names. These are too easily changed and when they are any hard coded tab names will cause a macro to fail.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    11-20-2019
    Location
    London
    MS-Off Ver
    Microsoft Office 365 V1910
    Posts
    81

    Re: Macro for copying from one sheet and pasting into another

    That's working perfectly now, I changed Sheet 1 and Sheet 6 - and it's picking it up.

    Thanks.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro for copying from one sheet and pasting into another

    There are ways of copying just say cells with formulae or constants and I missed your last comment about only copying cells with data.
    However if cells are blank and you copy those too isn't the result essentially the same as copying the whole range blanks constants and formulae included?

+ 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] VBA macro for conditional copying and pasting into new sheet
    By JSH2017 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2018, 11:00 PM
  2. Replies: 8
    Last Post: 02-01-2016, 09:30 AM
  3. [SOLVED] Macro is copying and pasting into cell A2 on new sheet instead of cell A1 Please Help!
    By AMFISH in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2014, 03:54 PM
  4. Copying & pasting a current region to another sheet w/o actually copying.....
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2014, 09:08 PM
  5. Macro - For copying columns from one sheet onto another is pasting a picture instead
    By Thorxes1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-31-2014, 04:54 PM
  6. Using a macro to copying data from 1 sheet, and pasting into next empty cell
    By Varial in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2012, 04:05 PM
  7. [SOLVED] Macro for Finding Sheet Names, then Copying/Pasting Values
    By Joel.Nemec in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-09-2012, 01:28 PM

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