#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default looping

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default looping


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default looping

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
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
Help with looping dok112[_55_] Excel Programming 0 November 1st 05 05:09 PM
Not Looping Through teresa Excel Programming 2 June 5th 05 10:33 PM
looping every third row Jason Hancock Excel Programming 5 July 1st 04 08:00 PM
Looping [email protected] Excel Programming 0 October 31st 03 07:47 PM
Looping Stuart[_9_] Excel Programming 0 October 29th 03 11:31 PM


All times are GMT +1. The time now is 09:25 AM.

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

About Us

"It's about Microsoft Excel"