+ Reply to Thread
Results 1 to 7 of 7

Set copy range from "A2" down to first completely empty row?

  1. #1
    Registered User
    Join Date
    11-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    61

    Set copy range from "A2" down to first completely empty row?

    Hi All,
    I have the following code I found on the web and am having a difficult time setting my copy range from "A2:first completely empty row". I've put starts next to the bit of code that calls out the copy range that I think needs to be changed. Any help would be greatly appreciated.


    Please Login or Register  to view this content.
    Thank you.
    Last edited by JBeaucaire; 03-31-2014 at 04:47 PM. Reason: Corrected [/code] tag

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,918

    Re: Set copy range from "A2" down to first completely empty row?

    For starters try:
    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    11-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Set copy range from "A2" down to first completely empty row?

    Proton,
    Thanks for the reply but this copies all of the data on the Sheet("Array 8"). I guess to be more clear, I have three "chunks" of data on Array 8. The number of rows that are used will vary for each "chunk", but there is always a blank row separating them. That is why I want to stop the copy at the first blank row after A2. Eventually I will need to copy all three of the chunks but I'm trying to get the code for just the first "chunk" to start. Any thoughts? Thanks again!

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,918

    Re: Set copy range from "A2" down to first completely empty row?

    Another suggestion:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Set copy range from "A2" down to first completely empty row?

    Proton,
    Thanks, I think that both of those solutions would work if my data wasn't so scattered among the columns and rows. Unfortunately, there are sometimes blank cells before the end of my data group.

    How about searching in Column A for a term, say "Dataset2", and then copy the info above that row? So the code would search through several rows in Column A until it hits the cell that contains the value "Dataset2", say for example, cell A22. The code then copies from (A2:V22), "22" being the variable row number above the one that "Dataset2" was found in. Thanks for all of your help with this.

    oh, and I had to change "Dim Topblock as Long" to "String" in order to get the above code to run. I don't know enough about VBA to explain why but it worked after I did that.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,918

    Re: Set copy range from "A2" down to first completely empty row?

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  7. #7
    Registered User
    Join Date
    11-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Set copy range from "A2" down to first completely empty row?

    Thanks proton but I solved it with a .range search. I'll give you some rep as your ideas will come in handy for other code uses. The code I used is below.

    Please Login or Register  to view this content.

+ 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] How to copy into next empty row using "for each cell in range" loop
    By GIS2013 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2013, 02:30 PM
  2. Replies: 3
    Last Post: 06-04-2011, 10:56 AM
  3. Why does =countif(range,"<>""") count empty cells?
    By Ingeniero1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-16-2008, 01:40 PM
  4. Replies: 4
    Last Post: 02-03-2008, 05:11 PM
  5. "" not completely blanc if copy
    By Esrei in forum Excel General
    Replies: 3
    Last Post: 06-13-2006, 08:20 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