+ Reply to Thread
Results 1 to 21 of 21

for each loop

  1. #1
    Registered User
    Join Date
    09-18-2019
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    14

    Question for each loop

    can help me to shorten this ??
    Please Login or Register  to view this content.

  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
    44,447

    Re: for each loop

    Instead of
    Please Login or Register  to view this content.
    you can use
    Please Login or Register  to view this content.
    That means you can introduce a column counter, for example, lCol
    Then you can use
    Please Login or Register  to view this content.
    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
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: for each loop

    Please Login or Register  to view this content.

  4. #4
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: for each loop

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  5. #5
    Registered User
    Join Date
    09-18-2019
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    14

    Re: for each loop

    thanks to you wideboydixon.. you're the best more power!!!

  6. #6
    Registered User
    Join Date
    09-18-2019
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    14

    Re: for each loop

    can you help me more with this sir wideboydixon??
    Please Login or Register  to view this content.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: for each loop

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  8. #8
    Registered User
    Join Date
    09-18-2019
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    14

    Re: for each loop

    ill try this one tomorrow sir because i will be out today and will continue tomorrow .. thanks again for spending time to my thread man.. hoping to know you more .. more power and god bless !!

  9. #9
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: for each loop

    Please Login or Register  to view this content.
    WBD

  10. #10
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: for each loop

    Note this has been cross-posted here.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  11. #11
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: for each loop

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    HTH
    Regards, Jeff

  12. #12
    Registered User
    Join Date
    09-18-2019
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    14

    Re: for each loop

    sorry forposting it twice and sorry for not reading the rules here i won't do such thing like this again .. thanks for reminding ..

  13. #13
    Registered User
    Join Date
    09-18-2019
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    14

    Re: for each loop

    WideBoyDixon thank you so much for helping my work .. I am hoping to learn more about looping still have last problem regarding to my code
    Please Login or Register  to view this content.

  14. #14
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: for each loop

    Quote Originally Posted by jeffersonss View Post
    sorry forposting it twice and sorry for not reading the rules here i won't do such thing like this again .. thanks for reminding ..
    Hi jeffersonss,

    This was not a reminder, this was a request for you to comply with the instructions about annotating a cross post so others can follow where the cross post exists.

  15. #15
    Registered User
    Join Date
    09-18-2019
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    14

    Re: for each loop

    HI jeffreybrown,

    okay, I understand now

  16. #16
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: for each loop

    Please Login or Register  to view this content.
    WBD

  17. #17
    Registered User
    Join Date
    09-18-2019
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    14

    Re: for each loop

    thank you so much senpai

  18. #18
    Registered User
    Join Date
    09-18-2019
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    14

    Re: for each loop

    i have an error in my oblbl .. it says that type mismatch

    Please Login or Register  to view this content.

  19. #19
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: for each loop

    That could happen if the current caption on the control is not a number. However, the existing code made the same assumption.

    WBD

  20. #20
    Registered User
    Join Date
    09-18-2019
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 2013
    Posts
    14

    Re: for each loop

    any solution for this problem WBD? Have a nice day by the way Mr. WideBoyDixon

  21. #21
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: for each loop

    Not without getting a copy of the workbook. I can't work blindfolded

    WBD

+ 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] VBA to loop through cell-defined range and paste table output after each loop.
    By mscott123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2019, 03:41 AM
  2. Replies: 13
    Last Post: 07-08-2018, 05:22 AM
  3. [SOLVED] (Beginner help) For loop inside do loop that displays information from reference sheet.
    By lediable007 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-08-2016, 03:20 PM
  4. [SOLVED] Auto email loop with formatted table data breaking on second loop VBA
    By Who_else in forum Excel General
    Replies: 6
    Last Post: 03-24-2016, 06:22 AM
  5. [SOLVED] VBA to loop within a loop of multiple blocks of data (currentregion) ... Expert needed
    By Jim885 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2016, 08:28 PM
  6. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  7. 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

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