Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 , McKCollins 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 "McKCollins" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need Help on Making a Loop | Excel Programming | |||
Making Macros in Excel | Excel Programming | |||
Looking for help with macros and chart making. | Excel Programming | |||
Making a copy using macros | Excel Programming | |||
Making excel macros run Word macros | Excel Programming |