+ Reply to Thread
Results 1 to 4 of 4

Help amending my for loop

  1. #1
    Registered User
    Join Date
    06-14-2023
    Location
    dublin, ireland
    MS-Off Ver
    2019
    Posts
    26

    Post Help amending my for loop

    Hi,

    I have a excel list of client email addresses & reference numbers that my code loops through and sends emails based on this list. In my test excel doc i have 6 rows - my loop is hard coded to loop through this amount of rows. I need to amend my loop to be able to go through any number of rows as i could have 6 rows now but 36 in a weeks time and 56 in a months time - the number of rows will vary. is there loop doe that would work for my requirements?

    this is my current code:

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    917

    Re: Help amending my for loop

    All you need to do is change this line from:
    Please Login or Register  to view this content.
    to:
    Please Login or Register  to view this content.
    It now will find the last used cell in column B and use it in your For/Next loop.
    Last edited by rollis13; 06-14-2023 at 11:59 AM.

  3. #3
    Registered User
    Join Date
    06-14-2023
    Location
    dublin, ireland
    MS-Off Ver
    2019
    Posts
    26

    Cool Re: Help amending my for loop

    Thats worked out great - thank you very much

  4. #4
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    917

    Re: Help amending my for loop

    Thanks for the positive feedback , glad having been of some help.

+ 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] Need help in amending code
    By jp16 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-22-2017, 02:07 AM
  2. amending someone else's spreadsheet
    By scorpio_witch in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 07-31-2013, 01:40 PM
  3. [SOLVED] Amending a Key formula
    By pauldaddyadams in forum Excel General
    Replies: 18
    Last Post: 10-06-2012, 04:37 PM
  4. Help with VBA amending
    By sideshow1987 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-26-2011, 07:32 AM
  5. Amending Sub totals
    By AK262007 in forum Excel General
    Replies: 1
    Last Post: 05-01-2009, 10:40 AM
  6. Amending an if statement
    By isolation123 in forum Excel General
    Replies: 27
    Last Post: 03-13-2008, 08:02 AM
  7. Help with Amending this Code Please
    By [email protected] in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-01-2005, 03:06 PM

Tags for this Thread

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