Re: Do Loop until empty row (column "A")
- From: Jim15 <Jim15.1ttf6f_1124125560.6021@xxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 15 Aug 2005 11:39:31 -0500
Rows P - Y still empty with modification below. Any suggestions? It
appears the loops is not executing with the following code.
Jim
Range("P2").Select
'
' Start of row calculations.
'
Dim rng As Range, i As Long
i = 2
Set rng = Cells(i, 1)
Do While (Selection.Offset(1, 0) <> "")
'
' Calculate columns P - Y.
'
Cells(ActiveCell.Row, "P").FormulaR1C1 = "=IF(RC[-7]=0,""
"",(RC[-6]*1000)/RC[-7])"
Cells(ActiveCell.Row, "Q").FormulaR1C1 = _
"=IF((RC[-8]+RC[-6])=0,"" "",(RC[-7]*1000)/(RC[-8]+RC[-6]))"
Cells(ActiveCell.Row, "R").FormulaR1C1 = "=IF(RC[-9]=0,""
"",RC[-7]/RC[-9])"
Cells(ActiveCell.Row, "S").FormulaR1C1 = _
"=IF((RC[-10]+RC[-8])=0,"" "",RC[-8]/(RC[-10]+RC[-8]))"
Cells(ActiveCell.Row, "T").FormulaR1C1 = "=IF(RC[-11]=0,""
"",RC[-10]/RC[-11])"
Cells(ActiveCell.Row, "U").FormulaR1C1 = "=IF(RC[-11]=0,""
"",RC[-12]/RC[-11])"
Cells(ActiveCell.Row, "V").FormulaR1C1 = "=IF(RC[-12]=0,""
"",RC[-11]/RC[-12])"
Cells(ActiveCell.Row, "W").FormulaR1C1 = "=SUM(RC[-14]/30)"
Cells(ActiveCell.Row, "X").FormulaR1C1 = "=SUM(RC[-14]/30)"
Cells(ActiveCell.Row, "Y").FormulaR1C1 = "=SUM(RC[-14]/30)"
'
' Next row.
'
i = i + 1
Set rng = rng.Offset(1, 0)
Loop
--
Jim15
------------------------------------------------------------------------
Jim15's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=26300
View this thread: http://www.excelforum.com/showthread.php?threadid=395789
.
- References:
- Do Loop until empty row (column "A")
- From: Jim15
- Re: Do Loop until empty row (column "A")
- From: Tom Ogilvy
- Re: Do Loop until empty row (column "A")
- From: Jim15
- Do Loop until empty row (column "A")
- Prev by Date: RE: Filling an Array with a "For Next" Statement
- Next by Date: Re: Simple for you hard for me (newbie alert)
- Previous by thread: Re: Do Loop until empty row (column "A")
- Next by thread: Re: Do Loop until empty row (column "A")
- Index(es):
Relevant Pages
|