+ Reply to Thread
Results 1 to 2 of 2

VBA code to make a macro repeat as long as there is data in the column

  1. #1
    Registered User
    Join Date
    02-28-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA code to make a macro repeat as long as there is data in the column

    I have a macro that I need to run continuously until there is no more data in the up and coming column. I have a macro that precedes this one, which adds 6 columns and fills it with data. I have a macro written that adds the data for the first group of six columns, and I need that to loop as long as there is data in the next six column until there is no more data in any of the columns.

    I'm looking for something that I would put around the macro, something along the lines of;

    Please Login or Register  to view this content.
    I believe this would be the best way for the macro to run, or would I just include the Sheets and application run inside of the Do...Loop.

    Thanks for the help
    Last edited by Paul; 02-28-2012 at 05:08 PM. Reason: Added CODE tags. Please do this yourself in the future.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: VBA code to make a macro repeat as long as there is data in the column

    Hi

    If you have something in a row that will always be completed (headings perhaps), then you can use that to determine the last column.

    Then you could do a for / next loop with a step of 6 and do your action.

    Another way is similar, but use a for / next with a step of 6 and test a cell to see if there is data.
    Please Login or Register  to view this content.
    To be more specific, how about putting up an example file.

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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