+ Reply to Thread
Results 1 to 4 of 4

First visible cell row number to use in For-Next

  1. #1
    Forum Contributor
    Join Date
    11-10-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2013
    Posts
    297

    First visible cell row number to use in For-Next

    I have autofilter in Range D11:E11 and data goes down from D11:E11 to 50000th rows.

    I use for all (generally )
    Please Login or Register  to view this content.
    code for-next statement.(İn this condition "12" is fixed)

    But now when make autofilter for D11 (example for only 1 item) first visible cell comes as D135 and E135.

    I want to use automatically 135as variable instead of fixed 12 in for i code.( This 135th row changes depending autofilter values)

    How can I modify this For i code to use variable first visible cell row number?

    Thanks in advance for any reply and help.

    Regards,
    turist

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: First visible cell row number to use in For-Next

    Try this:


    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: First visible cell row number to use in For-Next

    If you want to ONLY cycle your loop through the VISIBLE filtered rows, switch from a LONG variable loop to a RANGE variable loop.


    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    11-10-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2013
    Posts
    297

    Re: First visible cell row number to use in For-Next

    Thanks all.
    Worked very good.

+ 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] Count data 2 criteria (visible & not 0 number)
    By Jhon Mustofa in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-10-2014, 01:00 AM
  2. Count number of visible rows
    By gan_xl in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-29-2013, 03:10 PM
  3. Number visible cells only
    By britt@wjg in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-08-2013, 09:22 AM
  4. Row number of first visible cell in a filtered range
    By rcdgreat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2012, 06:30 PM
  5. Replies: 0
    Last Post: 09-27-2006, 02:05 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