Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I loop this code until the cell that the data is comming from is empty?
Sub clovis_time() activecell.Offset(0, 0).Range("A1").Select activecell.FormulaR1C1 = "=(RC[-1]-INT(RC[-1]))*24" End Sub Data in b1 is comming from the formula and a1! Any help would be greatly appreciated, thanks neal. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I'm not sure if I understand correctly, but if I do then this should work for you: Sub clovis_time() Dim i As Integer i = 0 Range("B1").Select Do ActiveCell.Offset(i, 0).FormulaR1C1 = "=(RC[-1]-INT(RC[-1]))*24" i = i + 1 Loop Until IsEmpty(ActiveCell.Offset(i, -1)) End Sub Neal Wrote: How do I loop this code until the cell that the data is comming from is empty? Sub clovis_time() activecell.Offset(0, 0).Range("A1").Select activecell.FormulaR1C1 = "=(RC[-1]-INT(RC[-1]))*24" End Sub Data in b1 is comming from the formula and a1! Any help would be greatly appreciated, thanks neal. -- Ikaabod ------------------------------------------------------------------------ Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371 View this thread: http://www.excelforum.com/showthread...hreadid=543855 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much, the code worked great.
"Ikaabod" wrote: I'm not sure if I understand correctly, but if I do then this should work for you: Sub clovis_time() Dim i As Integer i = 0 Range("B1").Select Do ActiveCell.Offset(i, 0).FormulaR1C1 = "=(RC[-1]-INT(RC[-1]))*24" i = i + 1 Loop Until IsEmpty(ActiveCell.Offset(i, -1)) End Sub Neal Wrote: How do I loop this code until the cell that the data is comming from is empty? Sub clovis_time() activecell.Offset(0, 0).Range("A1").Select activecell.FormulaR1C1 = "=(RC[-1]-INT(RC[-1]))*24" End Sub Data in b1 is comming from the formula and a1! Any help would be greatly appreciated, thanks neal. -- Ikaabod ------------------------------------------------------------------------ Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371 View this thread: http://www.excelforum.com/showthread...hreadid=543855 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with looping | Excel Programming | |||
Not Looping Through | Excel Programming | |||
looping every third row | Excel Programming | |||
Looping | Excel Programming | |||
Looping | Excel Programming |