+ Reply to Thread
Results 1 to 5 of 5

blank cells that have been pasted being counted as useddata

  1. #1
    Registered User
    Join Date
    02-22-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    20

    blank cells that have been pasted being counted as useddata

    so i've got a sheet where i'm copying and pasting data from another sheet to form a list.

    The problem is that the selection (a 5x3 area) could have from 1 entry per row to 5 so could have as much as 4 blank rows. Then when I come to using the macro again, using xlDown it counts those blank cells as if they have data in them and pastes the new data further down the column rather than the end of the current data.

    Here's the code I have but I don't think this is the problem.

    Please Login or Register  to view this content.
    Last edited by Muckybox; 05-10-2017 at 04:29 PM.

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: blank cells that have been pasted being counted as useddata

    Maybe

    Please Login or Register  to view this content.
    Kind regards
    Leo

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: blank cells that have been pasted being counted as useddata

    If you copied cells with formulas that returned "" (empty strings), they aren't actually blank. Select the top left cell manually, then press CTRL+SHIFT+DOWN ARROW. If this selects the "blanks", that's the problem. You can avoid this in the future by using a variant variable to move your data. Assign you range to the variable, which contains the values as an array. Then assign those values to any range of the same shape as the original. The blanks will be true blanks.
    NOTE: LeoTaxi's post #2 is a good demonstration of this. ('arr' is the variant variable).
    Now, if you need to get rid of a bunch of "not-blank" blank rows, try this macro:
    Please Login or Register  to view this content.
    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 05-08-2017 at 07:08 PM.

  4. #4
    Registered User
    Join Date
    02-22-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    20

    Re: blank cells that have been pasted being counted as useddata

    Thanks, that worked! just had to very slighty modify the range from this
    Please Login or Register  to view this content.
    to this
    Please Login or Register  to view this content.
    haha
    Last edited by Muckybox; 05-10-2017 at 04:26 PM.

  5. #5
    Registered User
    Join Date
    02-22-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    20

    Re: blank cells that have been pasted being counted as useddata

    Thanks for 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. [SOLVED] Blank fields not being accurately counted on chart
    By Richie_m21 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 02-19-2015, 11:12 AM
  2. Replies: 4
    Last Post: 02-11-2015, 09:02 AM
  3. Replies: 2
    Last Post: 10-13-2014, 03:25 PM
  4. [SOLVED] Count cells in column unless they've already been counted
    By JB33 in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 04-04-2014, 11:41 AM
  5. Blank cell counted as zero
    By famchiroly in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-05-2014, 03:09 PM
  6. Blank cell counted as having data
    By sallyrh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2011, 10:40 PM
  7. Replies: 1
    Last Post: 04-03-2008, 04:49 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