+ Reply to Thread
Results 1 to 3 of 3

Copy/Paste Loop Needs to Recognize Blank Cells

  1. #1
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Copy/Paste Loop Needs to Recognize Blank Cells

    Hello Everyone,

    I currently have a macro that loops through a copy/paste from one sheet to another. It copies column C with column S, T, U and pastes it in another sheet. Then it copies column C with V, W, X and pastes it at the bottom of the other data. Here is the current code I have in the macro:

    Please Login or Register  to view this content.
    My problem is, as you can see in the attached file - DataExample.xlsx - when you get to the end of the copy/paste columns, not all of the groups of the 3 columns have information on the last row. In the example provided, you'll see everything will copy/paste fine through AA, AB, AC. However, when the macro copies AD, AE, AF and tries to paste it, the macro will find the last filled out cell instead of the last copied cell from AA, AB, AC. Therefore, the data in Cell AE21 will not match up with the corresponding C21 data.

    I'm looking for a way to make it so that the code doesn't simply locate the last filled used row in sheet2 and paste the data, it will compensate for the blanks that were also copied/pasted.

    Please let me know if you have any questions!

    Thanks!

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy/Paste Loop Needs to Recognize Blank Cells

    See if this works:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Copy/Paste Loop Needs to Recognize Blank Cells

    Seems to work great. Thanks Stephen

+ 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. Selection of loop data, move copy and paste data, and exclude blank rows
    By mav02004 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2013, 10:20 AM
  2. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  3. [SOLVED] Find first non-blank cell after a group of blanks copy offset cells, find next blank, loop
    By gwsampso in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-21-2012, 06:11 AM
  4. [SOLVED] Need formula to recognize blank cells as zero
    By tiggynook in forum Excel General
    Replies: 2
    Last Post: 06-19-2012, 07:43 PM
  5. Excel 2007- Loop through Cells, paste in lowest blank one
    By Noobz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2009, 09:33 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