+ Reply to Thread
Results 1 to 2 of 2

How to specify a general row to start a for loop

  1. #1
    Registered User
    Join Date
    06-19-2017
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    33

    How to specify a general row to start a for loop

    So right now I have a for loop like this:

    Please Login or Register  to view this content.
    lr is a long defined as

    Please Login or Register  to view this content.
    I want i to be defined as something like that, so it is general and not referring to a specific row. Any ideas?

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,624

    Re: How to specify a general row to start a for loop

    No. "i" is not the problem, the 24 is. You need:
    For i = StartRow to EndRow (lr in your case). However, it's up to you to determine the starting row base on some criteria like a name or date, etc. that can be found with a .Find or some other calculation.
    Ben Van Johnson

+ 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] Excel VBA Loop to Format General Ledger
    By Hoover5896 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-19-2017, 09:05 AM
  2. Replies: 3
    Last Post: 04-23-2016, 01:42 AM
  3. [SOLVED] I HAVE NO CLUE! General loop/reference/if/case help.
    By KATIEexcel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-19-2012, 01:05 PM
  4. how to loop in general and then apply .getelementsbyID
    By jayinthe813 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2012, 08:45 PM
  5. Why did an inner loop variable start overwriting the outer loop range suddenly?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2012, 03:24 PM
  6. General Loop question
    By jhahes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2005, 01: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