+ Reply to Thread
Results 1 to 4 of 4

VBA to find first row under header, after filter has been applied.

  1. #1
    Registered User
    Join Date
    01-20-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    32

    VBA to find first row under header, after filter has been applied.

    Hi All...

    Very trivial question, but its bugging me a lot....

    I currently run the below code...

    ActiveSheet.Columns("A:C").AutoFilter Field:=3, Criteria1:="<>DATA", Operator:=xlAnd
    ActiveSheet.Columns("A").AutoFilter Field:=1, Criteria1:="<>"

    Range("C21").Select


    ActiveCell.Formula = "=VLOOKUP(A21,'DATA'!$G:$V,16,0)"
    Dim LastRow As Long
    LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
    Range("C21:C" & LastRow).FillDown


    Which basically autofilters, then runs a vlookup on C21 and autofills down.
    However C21 is likely to change on a daily basis after my autofilter is run....

    I am trying to figure out my code to say Autofilter / Find first row after Row B (a+b both being headers) / go to column C, and then run Vlookup and fill down.

    Any help or tips would greatly be appreciated.

    Thank you kindly

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: VBA to find first row under header, after filter has been applied.

    Welcome to the forum.

    We'd like to help you but first..

    Pls take some minutes to read forum rules and specially-in this case- rule#3.

    Edit:

    Based on your previous thread you look like ti ignore Moderators requests.

    http://www.excelforum.com/excel-gene...selection.html
    Last edited by Fotis1991; 01-28-2014 at 11:01 AM. Reason: Edit
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    01-20-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: VBA to find first row under header, after filter has been applied.

    Apologies.... the tag icon was not on my screen.... not intentionally ignored.

    I have manually put the code tags in, and hope this works once posted.

    Thank you kindly


    Hi All...

    Very trivial question, but its bugging me a lot....

    I currently run the below code...

    [code]ActiveSheet.Columns("A:C").AutoFilter Field:=3, Criteria1:="<>DATA", Operator:=xlAnd
    ActiveSheet.Columns("A").AutoFilter Field:=1, Criteria1:="<>"

    Range("C21").Select


    ActiveCell.Formula = "=VLOOKUP(A21,'DATA'!$G:$V,16,0)"
    Dim LastRow As Long
    LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
    Range("C21:C" & LastRow).FillDown[code]

    Which basically autofilters, then runs a vlookup on C21 and autofills down.
    However C21 is likely to change on a daily basis after my autofilter is run....

    I am trying to figure out my code to say Autofilter / Find first row after Row B (a+b both being headers) / go to column C, and then run Vlookup and fill down.

    Any help or tips would greatly be appreciated.

    Thank you kindly

  4. #4
    Registered User
    Join Date
    01-20-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: VBA to find first row under header, after filter has been applied.

    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] "find" method malfunction when filter is applied
    By hhost in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2013, 07:33 AM
  2. Replies: 0
    Last Post: 04-18-2011, 02:22 PM
  3. Adding a new row to a list when filter is applied
    By Macster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2009, 04:20 AM
  4. Can a header be applied once to a workbook & print on each page?
    By Christine Sullivan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2006, 01:40 PM
  5. [SOLVED] how do i identify first and last row once filter applied
    By pete the greek in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-21-2006, 12:25 PM

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