Results 1 to 3 of 3

Thread: Dynamic for loop

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    97

    Dynamic for loop

    Hi all

    I am asking if I can make dynamic for next according filled range because most of my friends are using standard for next loop as the following:

    Code:
    for i = 0 to 1000
    I want for loop works until filled range finish and this range is changable

    what can I put instead of 1000 to let for loop to be dynamic

    thanks

  2. #2
    New Member
    Join Date
    Jun 2011
    Posts
    4

    Re: Dynamic for loop

    take a variable and store

    dim LastRow as long

    LastRow = cells(cells.rows.count,"A").end(xlUP).row

  3. #3
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: Dynamic for loop

    also can be like this
    Code:
    Dim LastRow As Long
    LastRow = Sheets(1).Range("A65536").End(xlUp).Row
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width