Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help on Making a Loop japorms[_7_] Excel Programming 2 September 16th 05 01:52 PM
Making Macros in Excel mike b Excel Programming 3 April 2nd 05 01:52 PM
Looking for help with macros and chart making. mike drav Excel Programming 2 January 26th 05 06:04 PM
Making a copy using macros legepe[_10_] Excel Programming 0 October 23rd 04 02:20 AM
Making excel macros run Word macros Matthew McManus Excel Programming 1 February 18th 04 02:57 AM


All times are GMT +1. The time now is 04:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"