+ Reply to Thread
Results 1 to 2 of 2

How can I copy data in a column until the next cell is ""?

  1. #1
    Registered User
    Join Date
    12-19-2020
    Location
    Turkey
    MS-Off Ver
    2019
    Posts
    19

    How can I copy data in a column until the next cell is ""?

    Hi guys,

    I have written this code that draws data from one sheet to another (Please see the code below). I use a do until loop to do this. But I have 2 problems with it.

    1. I have a formula commanding to return "" in case of an error in the original data and I don't want the code to draw the empty data (meaning the ones with ""). Hence "End(xlUp).Row" is not cutting it for me. How can I achieve this?
    2. In the code, the copy and paste selection ranges are supposed to go to the end but it just copies the first row of the selected columns and that's it.

    It's crucial for me to stop copying if the cell is "" and not absolute blank because I will use the copied data to create a pivot table. If the data with "" formula is there, it will pick it up as data and include it in the table, ruining my slicers.

    Thank you very much in advance!

    Please Login or Register  to view this content.
    Last edited by Allan91; 12-22-2020 at 06:30 AM. Reason: Title Clarification

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,379

    Re: Do Until Lastrow=""

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

+ 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 picked the wrong column when specifying Range("B" & lastrow)
    By lynnsong986 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-05-2020, 07:34 AM
  2. Ignore "if" formula for Lastrow function
    By bsrivatsa in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-13-2018, 03:44 PM
  3. [SOLVED] Using "lastRow" to create dynamic code
    By NatalieW12 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2017, 05:29 AM
  4. [SOLVED] Need help modifying multiple range code to include LastRow ("B2:B10",..) -> ("B2:B" & LR.)
    By sureng20 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-09-2017, 09:31 AM
  5. Trying to improve speed of Index match, want to lookup "A1:A" & lastrow
    By OTWarrior in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 05-11-2017, 12:38 PM
  6. [SOLVED] Adding "Lastrow" function to these formulas:
    By Chad Bateman in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-25-2015, 10:59 PM
  7. How to transpose data into range ("A1:G" & lastrow)
    By jasondu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2012, 10:39 AM

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