+ Reply to Thread
Results 1 to 8 of 8

How to select the first blank cell after filtering?

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    Midlands,UK
    MS-Off Ver
    Excel 2007
    Posts
    17

    How to select the first blank cell after filtering?

    Hi all

    Still a novice in VBA so I could with a hand. I do a report where I currently filter Column B by blanks then add a vlookup connecting to another file to 'fill-in' the missing cells. How can I automate this in VBA?

    Do I

    1. Add the filter, like below, and enter some sort of code under 'Range("B1") that would make it go to the first blank cell in column b and from there I can use the autofill selection.
    My attempt (I thought maybe offset could work with a filter but obviously not.....)
    Please Login or Register  to view this content.
    2. Approach it from some kind of Loop angle. If so, how would I do this? Is there something I can do that would make it start at B2, check if it's blank, enter a formula if so,pass if contains data, continue until the data ends in column a for that day (which shows the job numbers for the day)

    Any help would be great. Cheers
    Last edited by JimmyCobblers; 04-17-2013 at 07:24 AM. Reason: Typo

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to select the first blank cell after filtering?

    Hi Jimmy,

    You need to select first blank cell after the filtered data ?
    Or,
    you need to select the first blank cell with-in the filtered data. If Yes, then how you are filtering that it shows any blank there, I would like to see that. Thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey
    +91 9810929744
    dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    04-11-2013
    Location
    Midlands,UK
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: How to select the first blank cell after filtering?

    Hi Dili

    I think I am barking up the wrong tree with the filter idea...
    I've attached an example spreadsheet with what I'd like to do in VBA, is this possible with some kind of loop? Do it in column b until column a is empty?
    Attached Files Attached Files

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to select the first blank cell after filtering?

    HI Jimmy,

    You need to put up vlookup in blank cells of column B till column A has data.. correct ?
    Now, from where to lookup the data ?

    Regards,
    DILIPandey
    <click on below * if this helps>

  5. #5
    Registered User
    Join Date
    04-11-2013
    Location
    Midlands,UK
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: How to select the first blank cell after filtering?

    Yes that's right, the data for the lookup is on another sheet. If you have a solution we call this "MySheet" and I'll amend the address later in the code?

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to select the first blank cell after filtering?

    Okay.. use below code and update your formula in it before running :-


    Please Login or Register  to view this content.
    example.xls

    Regards,
    DILIPandey
    <click on below * if this helps>

  7. #7
    Registered User
    Join Date
    04-11-2013
    Location
    Midlands,UK
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: How to select the first blank cell after filtering?

    Thanks DiliPandey that has worked how I wanted it to. - Jimmy

  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to select the first blank cell after filtering?

    Great..!!

    Please mark this thread as [SOLVED].. thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>

+ 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