+ Reply to Thread
Results 1 to 7 of 7

Loop till empty cell

  1. #1
    Registered User
    Join Date
    08-20-2017
    Location
    Istanbul, Turkiye
    MS-Off Ver
    2016
    Posts
    97

    Loop till empty cell

    Hi,
    i have below macro and i need your help to run it continuously till empty cell in column N. Thank you.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Loop till empty cell

    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    08-20-2017
    Location
    Istanbul, Turkiye
    MS-Off Ver
    2016
    Posts
    97

    Re: Loop till empty cell

    Dear JLGWhiz,
    thank you for your interest, however i need the macro to do below;

    first - send the mail
    second - delete X on top
    third - send the mail again
    forth - delete X on top
    ....
    until there is no non-blank cell in I (it was N before, i updated your accordingly before use)
    your nice code worked as
    1 - send mail
    2 - delete all X on column
    3 - stopped

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Loop till empty cell

    delete X on top
    What do you mean by this ?
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Loop till empty cell

    I think the OP means that the Xs are being used as a counter to control the number of Emails sent and by deleting one every loop, when there are no more Xs the code stops. But I can't be sure that is what the OP wants from the paucity of information provided. If a sample file was uploaded for us to review, maybe we could figure it out.

    Maybe this:

    Please Login or Register  to view this content.
    Last edited by JLGWhiz; 02-17-2019 at 10:48 PM.

  6. #6
    Registered User
    Join Date
    08-20-2017
    Location
    Istanbul, Turkiye
    MS-Off Ver
    2016
    Posts
    97

    Re: Loop till empty cell

    Quote Originally Posted by JLGWhiz View Post
    I think the OP means that the Xs are being used as a counter to control the number of Emails sent and by deleting one every loop, when there are no more Xs the code stops. But I can't be sure that is what the OP wants from the paucity of information provided. If a sample file was uploaded for us to review, maybe we could figure it out.

    Maybe this:

    Please Login or Register  to view this content.
    dear jlgwhiz,
    code sends first mail but then stops with attached error
    Attached Images Attached Images

  7. #7
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Loop till empty cell

    I have not worked with MailEnvelope before, so I could have the loop starting and ending in the wrong place. I am not going to spend a lot of time researching how to use the MailEnvelope, so maybe somebody else with more knowledge of the issue will step in and assist you.

+ 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] Loop copy cell of range to 1 cell, and so on till cell empty
    By countryfan_nt in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2017, 02:33 AM
  2. Replies: 2
    Last Post: 07-21-2016, 09:40 PM
  3. LOOP through visible rows till empty - error code?
    By brainzlp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2016, 01:01 AM
  4. [SOLVED] Search backward in range till empty cell
    By fedude in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-06-2013, 08:00 AM
  5. [SOLVED] How to autofill any formula till last empty cell
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-16-2013, 08:56 AM
  6. [SOLVED] Looping till empty cell
    By Alexander_Golinsky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-02-2012, 02:11 PM
  7. Fill array till first empty cell.
    By UncleDucc in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-05-2009, 09:56 AM

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