+ Reply to Thread
Results 1 to 2 of 2

repeat macro until empty space in next column

  1. #1
    Sabba Efie
    Guest

    repeat macro until empty space in next column

    Assume two columns. I want to perform an operation on a cell in the first
    column and then repeat that operation on the cell below as long as there is
    at least one character in the second column. When the second column is blank
    the operation stops. I set up a macro to perform the operation and move down
    one cell. Now I want to check the second column and repeat the macro until a
    blank cell is reached.

  2. #2
    David Billigmeier
    Guest

    RE: repeat macro until empty space in next column

    Try something like this... replace ActiveCell.Offset(i,0) = "a" with the
    operation you are looking to perform:

    Sub repeat()
    i = 0
    Range("A1").Select
    While (ActiveCell.Offset(i, 1) <> "")
    ActiveCell.Offset(i, 0) = "a"
    i = i + 1
    Wend
    End Sub


    --
    Regards,
    Dave


    "Sabba Efie" wrote:

    > Assume two columns. I want to perform an operation on a cell in the first
    > column and then repeat that operation on the cell below as long as there is
    > at least one character in the second column. When the second column is blank
    > the operation stops. I set up a macro to perform the operation and move down
    > one cell. Now I want to check the second column and repeat the macro until a
    > blank cell is reached.


+ 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