+ Reply to Thread
Results 1 to 3 of 3

Copy only cells with data in

  1. #1
    Registered User
    Join Date
    11-26-2011
    Location
    Yeovil, england
    MS-Off Ver
    365
    Posts
    73

    Copy only cells with data in

    Hi,

    I have the following code for copying two sheets in one workbook to another workbook. However, the subsequent running of the program always pastes to where the last time had even if there were blank cells and I'm asking it to paste values only.

    E.G. the first time run the range is copied, then pasted and goes to row 50, however there is only data up to row 25. Next time same macro is run it starts pasting at row 51. IS there a modification someone can suggest that means only populated cells are copied or pasted rather than copying a fixed range?

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    2021
    Posts
    324

    Re: Copy only cells with data in

    Hello. Without an example file... Try the following code, maybe I guessed right. Not sure but...
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-26-2011
    Location
    Yeovil, england
    MS-Off Ver
    365
    Posts
    73

    Re: Copy only cells with data in

    Hi,

    Thank you for the reply. It still copies a range on the L and G sheet regardless of data in there or not so I end up with same problem, the next time the macro is run it pastes right at the end of the previous area of pasted data even though the cells are all blank. i think the code was a little mixed up as both results went on the g sheet. i appreciate the help.

+ 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. VBA macro to copy Realtime data from cells (Changing data) to another cells
    By neo2019 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2019, 10:38 AM
  2. [SOLVED] Copy data range but ignore (not copy) cells with formula
    By mattman1968 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 03-25-2019, 06:00 PM
  3. Replies: 3
    Last Post: 01-29-2018, 11:48 PM
  4. Replies: 1
    Last Post: 10-09-2015, 10:10 PM
  5. Replies: 0
    Last Post: 05-27-2015, 10:23 AM
  6. [SOLVED] Copy Filter Data and paste it on another workbook with special cells(Only Visible Cells)
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-13-2014, 07:59 AM
  7. [SOLVED] VBA to Copy set data, paste into set cells, then copy more & set into cells related 2 date
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 99
    Last Post: 02-01-2013, 08:43 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