+ Reply to Thread
Results 1 to 7 of 7

Find first blank cell after Auto Filter

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Find first blank cell after Auto Filter

    Greetings, Gurus.

    Suppose I am using auto filter on a range to filter down to only the blank cells in column C, and then I want to enter a formula into all those blank cells. How would I determine the range of the first blank cell? Here's what I have so far:

    Please Login or Register  to view this content.
    Thanks in advance for any help you can offer.
    Last edited by [email protected]; 05-05-2010 at 11:40 AM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Find first blank cell after Auto Filter

    Hi, Could you use this, The "Specialcells" function will Give you the addresses of the Blank Cells, and then next line will fill them with th Formula.
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Find first blank cell after Auto Filter

    Thanks for the reply, Mick. When I tried your code, I got the following error:
    Run-time error '1004': No cells were found. The debug highlighted the following line:

    Set Rng = Rng.SpecialCells(xlCellTypeBlanks)

    Yes, there are blank cells in the range.
    Last edited by [email protected]; 05-04-2010 at 11:48 AM.

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Find first blank cell after Auto Filter

    Hi, I know this sounds rather obvious but, I can only suggest you try the code on a new sheet.
    Place data in column "C", then Delete some of the values.
    See what the code returns.
    Regards Mick

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Find first blank cell after Auto Filter

    Sorry so slow to repond, Mick. I had to leave the office early yesterday.

    I figured out the problem. The reason your script isn't finding any empty cells is because of the line:
    Please Login or Register  to view this content.
    It is telling it to only look in cells that already contain data. How would I chnage that line to look at all cells in column C, down to the last row in column A. I tried

    Please Login or Register  to view this content.
    but I get a "Method 'Range' of object '_Global' failed" error.

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Find first blank cell after Auto Filter

    Hi, Try :-
    Please Login or Register  to view this content.
    Regards Mick

  7. #7
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Find first blank cell after Auto Filter

    Perfect! Here's the final code as I use it:
    Please Login or Register  to view this content.
    Thanks, Mick. Have a good one.

+ 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