+ Reply to Thread
Results 1 to 11 of 11

Find first blank cell in column if rightmost cell is non blank

  1. #1
    Registered User
    Join Date
    01-23-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    52

    Talking Find first blank cell in column if rightmost cell is non blank

    Hello,

    I am trying to figure out how to select a blank cell if the cell next to it is a non-blank cell.

    This is the code I have so far. It just finds the first blank cell in a column.

    Please Login or Register  to view this content.
    So what I am looking for is if a cell in Col B is a non blank, select the first non blank in Col A in the same row.

    I will ultimately use this as a loop to paste copied data from another macro.

    Thanks for the help!
    Last edited by Mothman; 09-19-2010 at 02:11 AM. Reason: Typo on subject

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Find first blank cell in column if rightmost cell is non blank

    hey Mothman

    can you attach a workbook with before and after results ?
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Find first blank cell in column if rightmost cell is non blank

    If what you are saying is that column B is "complete", that is, has data in every row, and you want to find the next "free" (blank) cell in column B and then add something into the cell in column A on the same row, you could use:

    Please Login or Register  to view this content.

    Regards

  4. #4
    Registered User
    Join Date
    01-23-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Find first blank cell in column if rightmost cell is non blank

    Here is an example sheet, explaining what I am trying to do. Thanks for the time!
    Attached Files Attached Files

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Find first blank cell in column if rightmost cell is non blank

    Please Login or Register  to view this content.


    Regards

  6. #6
    Registered User
    Join Date
    01-23-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Find first blank cell in column if rightmost cell is non blank

    Thanks for the help so far. But I'm still missing a piece of code that I need. My vba does not reference the column to the right and look for a nonblank. What you gave me just pastes in the first blank cell. If I were to loop it, it would paste all the way down the workbook. Sorry, hard to explain what I'm trying to do.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Find first blank cell in column if rightmost cell is non blank

    Please Login or Register  to view this content.

    Regards

  8. #8
    Registered User
    Join Date
    01-23-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Find first blank cell in column if rightmost cell is non blank

    Perfect!! Thank you very much for the help!

  9. #9
    Registered User
    Join Date
    01-23-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Find first blank cell in column if rightmost cell is non blank

    Okay... I am having trouble making the paste process repeat itself until there is a blank cell in the offset. Please help.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    01-23-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Find first blank cell in column if rightmost cell is non blank

    Nevermind, I figured it out.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Find first blank cell in column if rightmost cell is non blank

    Actually, thinking about it, it might be worth having the test earlier on. This would avoid asking the user to select a cell only to dash their hopes!

    Maybe:

    Please Login or Register  to view this content.


    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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