+ Reply to Thread
Results 1 to 5 of 5

Setting Loop to the smallest number needed

  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Setting Loop to the smallest number needed

    Thus far, when I want to loop something I just set the loop to be greater than what I need it to be.

    Please Login or Register  to view this content.
    But then I have to wait while the macro checks alot of empty cells below where I have the data. I know I could use

    Please Login or Register  to view this content.
    But could I do something similar to this??

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: Setting Loop to the smallest number needed

    Why not use a last row scenario. Something like this

    Please Login or Register  to view this content.
    In the above code, each of the columns will be filled with a formula from row 2 to the last row with data in column A. In your case, your i = i to lastrow
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Setting Loop to the smallest number needed

    Hey. It works. Thanks.

  4. #4
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Setting Loop to the smallest number needed

    How can I do this same thing with Columns? Can't seem to manage it.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: Setting Loop to the smallest number needed

    Try something like this:
    Please Login or Register  to view this content.
    This will get you the last column.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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