+ Reply to Thread
Results 1 to 22 of 22

Macro to Continue Loop untill empty cell

  1. #1
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Macro to Continue Loop untill empty cell

    Hi all,

    I'm strugling for a couple of days with following macro. My code should assign controller name from the "People list" to the "Tracker" sheet based on condition if he or she is marked as "In". This works perfect for me. However, once macro is on the end of the people list it's stop working. Or actually is doesn't continue.

    So what I basically want to modify it's to continue with macro untill Column I is empty. Is there anybody who could help?
    Please Login or Register  to view this content.

    Thank youuuuuuuuu,
    Andy

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,324

    Re: Macro to Continue Loop untill empty cell

    Maybe this:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to Continue Loop untill empty cell

    Hi TMS

    I've tested it but still not working, I've got error that objects does not exist I have no idea how to do this Or is there a way, that once A3, than A13, than A23 etc each 11th row is filled, controler name from the People list will be added automatically according to the criteria in people list?

    Thanks a lot for your help,
    Andy

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,324

    Re: Macro to Continue Loop untill empty cell

    Can you post a sample workbook. I've got nothing to test your code, or my code, with and I have no idea what the worksheets or data look like.

    Regards, TMS

  5. #5
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to Continue Loop untill empty cell

    Hi TMS,

    please apologize. I've uploaded the requested file.

    As well, i sthere a way to add criteria that if Agent name is same, to continue with next Contriler form people list?

    Thanks a lot for this.
    Andy
    Attached Files Attached Files

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,324

    Re: Macro to Continue Loop untill empty cell

    Amended code:

    Please Login or Register  to view this content.
    ... is there a way to add criteria that if Agent name is same, to continue with next Controller from people list?
    Sorry, I don't understand what you are asking for.


    Regards, TMS
    Last edited by TMS; 03-10-2015 at 01:51 PM.

  7. #7
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to Continue Loop untill empty cell

    Hi TMS,

    thanks for the update. I was checking your code and worked fine. :-) It copied only those names which are marked as " In". Which is correct, but only once, when macro is in the end of People list column.
    Is there a way, that macro could copy those "In" marked names more times, depending on sheet "Tracker", column "A", so untill last active cell? As well I realised, that when I mark more people as " IN", macro will overwrite already assigned names in "Tracker" sheet column "K". So basically, once name is assigned in column K, to not delete it.
    I will have 2000 lines in "Tracker" sheet, therefore, if this could be somehow automated, will be fine.

    Thank youuuuuu
    Andy

  8. #8
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to Continue Loop untill empty cell

    Hi,

    Is there abybody who coud help me to fix this macro?
    😕
    Thanks
    Andy

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to Continue Loop untill empty cell

    Maybe:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  10. #10
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to Continue Loop untill empty cell

    Hii


    thanks a lot. It works as never
    I just wanted to ask, that is it possible to add one small criteria, that once the Agent name is pasted to column K in "Tracker" sheet and is equal to agent name in column A "Tracker" sheet, that macro will skip this name and past the next one?

    Thank you a lot
    Andy

  11. #11
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to Continue Loop untill empty cell

    Hi,

    someone to help me with?

    Thanks a lot,
    Andy

  12. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to Continue Loop untill empty cell

    Hi dobracik,

    Thanks for the rep!

    BTW - your request only makes sense if the Controllers on the People sheet are not unique - is that the case??

  13. #13
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to Continue Loop untill empty cell

    Hi

    hmmmm, I don't understand your point. It's Friday already

  14. #14
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to Continue Loop untill empty cell

    that once the Agent name is pasted to column K in "Tracker" sheet and is equal to agent name in column A "Tracker" sheet, that macro will skip this name and past the next one?
    It already does this when it processes each row (x index) on the People sheet:|

  15. #15
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to Continue Loop untill empty cell

    I know, but might happened, that it assign personn from people list to same person in Tracker sheet.

    This is what I was asking, if it's possible

  16. #16
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to Continue Loop untill empty cell

    Try this:

    Please Login or Register  to view this content.
    Last edited by xladept; 03-14-2015 at 02:00 PM.

  17. #17
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to Continue Loop untill empty cell

    Hi,

    when I use that code, it always assugn same user in some cases.

    Example Agent 1 to Agent 1 Maybe I'm doing sometihng wrong

  18. #18
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to Continue Loop untill empty cell

    Can you explain again what you need? - I'm not quite clear on what you want

  19. #19
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to Continue Loop untill empty cell

    Hi,

    Yes, im so sorry for not beeing clear. :-(
    This tracker should help us when doing quality check. So,example if I mark to Agent 1 that is at work (in) in people sheet and run macro, this should not assign Agent 1 from people list to Agent 1 in Tracker sheet. As this person could not do the quality check on himself. So to have same macro as I have from you, but with condition, that will always assing diferent agents, not the same one.

    Sorry if not clear.

  20. #20
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to Continue Loop untill empty cell

    Try this:

    Please Login or Register  to view this content.

  21. #21
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    267

    Re: Macro to Continue Loop untill empty cell

    Juchuuuuu, works

    Thanks a lot you saved my life

  22. #22
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to Continue Loop untill empty cell

    You're welcome!

    A slight improvement:

    Please Login or Register  to view this content.

+ 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. Macro for conditional formatting range untill empty cell
    By Pavpav in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2013, 06:47 AM
  2. [SOLVED] macro to paste data untill the next empty row
    By winger in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-24-2012, 10:32 AM
  3. macro will not continue if cell is empty
    By Petezh193 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-16-2009, 12:44 PM
  4. Macro to loop untill zero value
    By coolhit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-10-2009, 05:44 PM
  5. Loop untill the first empty cell
    By karinos57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-08-2009, 01:40 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