+ Reply to Thread
Results 1 to 4 of 4

Ignore empty rows when performing copy and paste

  1. #1
    Forum Contributor
    Join Date
    04-04-2016
    Location
    dallas tx
    MS-Off Ver
    365 (15.0.5501.1000)
    Posts
    534

    Ignore empty rows when performing copy and paste

    I am using the following code to copy and paste a range of cells from one worksheet to another. The issue is that the cells that are currently blank are being copied as well. The data in the copy range will change so The number of empty rows will always vary. What can I add to the code to copy only the cells with data and ignore the empty rows?


    Please Login or Register  to view this content.
    It might be possible that excel is viewing the cells as having something in them when in reality they do not. They do contain formulas that populate the cell but show blank when there is nothing to populate them.
    Attached Files Attached Files
    Last edited by chriswrcg; 09-30-2021 at 10:17 AM.

  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: Ignore empty rows when performing copy and paste

    Hi,

    Maybe

    Please Login or Register  to view this content.
    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
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Ignore empty rows when performing copy and paste

    Try this code.
    Please Login or Register  to view this content.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Ignore empty rows when performing copy and paste

    Please Login or Register  to view this content.
    Last edited by sintek; 09-30-2021 at 12:10 PM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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 data and paste special from specific rows to next empty row
    By hkbhansali in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2019, 09:55 AM
  2. Replies: 1
    Last Post: 01-07-2019, 10:54 AM
  3. Copy every last row above next empty row and paste all rows to another sheet
    By littledic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-30-2017, 01:48 PM
  4. [SOLVED] How to Ignore copy and paste if filter finding is empty, Please help
    By vinod2802 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2016, 10:13 AM
  5. Copy specific rows from many files and paste into next empty row in master file
    By Rednalyn in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-08-2013, 09:13 AM
  6. Copy rows until empty row reached and paste in new worksheet
    By ebbo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-20-2013, 01:51 AM
  7. Copy rows until a empty cell and paste them into a new sheet or workbook
    By nkf531 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 03-05-2012, 06:27 AM

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