Results 1 to 6 of 6

Macro to loop actions until empty cell

Threaded View

  1. #1
    Registered User
    Join Date
    06-26-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    11

    Macro to loop actions until empty cell

    Hi,

    I have a list lengthy macro that populates several cells in a row (column A - E) based off the value in column F. I need all these steps to be repeated for the following row, and have this loop continue until there is no value in column F. How do I have a loop do this within the macro?

    To simplify it, here are the steps to populate the cells in column A and B.
        Range("A1").End(xlDown).Offset(1, 0).Select
        ActiveCell.FormulaR1C1 = _
            "=VLOOKUP(RC[6],'[First data.xlsm]Monthly.rpt'!data,2,FALSE)"
        Range("B1").Select
        Range("B1").End(xlDown).Offset(1, 0).Select
        ActiveCell.FormulaR1C1 = _
            "=VLOOKUP(RC[5],'[First data.xlsm]Monthly.rpt'!data,5,FALSE)"

    How do I have these two steps loop for the next row, etc until there is no more data in column F?

    Thanks in advance for your help.
    Robbie
    Last edited by RobbieMoulton; 06-29-2011 at 12:23 AM. Reason: Added Code Tags

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