+ Reply to Thread
Results 1 to 3 of 3

Making macros loop

  1. #1
    McKCollins
    Guest

    Making macros loop

    I have two columns, A and B. Column A has data, column B contains a formula.
    I want the formula in column B to loop down the rows (ie: B1, B2, B3 etc)
    until it reaches a blank in column A. I have tried Do Loop...While but I
    cannot make the loop work.
    Can anyone help with this?

    Many thanks.

    Collins

  2. #2
    JE McGimpsey
    Guest

    Re: Making macros loop

    One way:

    Public Sub InsertFormula()
    Const sFORMULA As String = "=SUM($A$1:A1)"
    Range("A1:A" & Range("A" & Rows.Count).End( _
    xlUp).Row).Offset(0, 1).Formula = sFORMULA
    End Sub




    In article <[email protected]>,
    McKCollins <[email protected]> wrote:

    > I have two columns, A and B. Column A has data, column B contains a formula.
    > I want the formula in column B to loop down the rows (ie: B1, B2, B3 etc)
    > until it reaches a blank in column A. I have tried Do Loop...While but I
    > cannot make the loop work.
    > Can anyone help with this?
    >
    > Many thanks.
    >
    > Collins


  3. #3
    Don Guillett
    Guest

    Re: Making macros loop

    might be quicker. If more than one, look in vba help for FIND and FINDNEXT.
    Example shown

    Sub looptillblank()
    x = Columns(1).Find("").Address
    MsgBox x
    End Sub

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "McKCollins" <[email protected]> wrote in message
    news:[email protected]...
    >I have two columns, A and B. Column A has data, column B contains a
    >formula.
    > I want the formula in column B to loop down the rows (ie: B1, B2, B3 etc)
    > until it reaches a blank in column A. I have tried Do Loop...While but I
    > cannot make the loop work.
    > Can anyone help with this?
    >
    > Many thanks.
    >
    > Collins




+ 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