Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I have the following macro... Range("b10").Select Do ActiveCell.FormulaR1C1 = ActiveCell.Offset(-1, 0) + 1 ActiveCell.Offset(1, 0).Select Loop Until ActiveCell.Offset(-1, 0).Value = Range("e1").Value Range("b1").Select It starts at b10 which is a date, 21 jun. it runs down the colum putting in the dates 22, 23, 24 June... until it gets to today's date it stops by checking the cell e1 which contains the formula =today(). this works fine, however as the days go on and on its going to tak longer and longer to run because it always starts at the beginning, 2 June in b10. Is there anyway to amend the code to force it to start at the max valu in column b? Any help/comments appreciated. (note: i dont want to use formulae eg =if(b11today(),"",b10+1) becaus all cells below todays date have to be empty. -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cells(rows.count,2).End(xlup)(2).Select
if activeCell.Row < 10 then Range("B10").Select Do ActiveCell.FormulaR1C1 = ActiveCell.Offset(-1, 0) + 1 ActiveCell.Offset(1, 0).Select Loop Until ActiveCell.Offset(-1, 0).Value = Range("e1").Value Range("b1").Select -- Regards, Tom Ogilvy "The Grinch " wrote in message ... Hi All, I have the following macro... Range("b10").Select Do ActiveCell.FormulaR1C1 = ActiveCell.Offset(-1, 0) + 1 ActiveCell.Offset(1, 0).Select Loop Until ActiveCell.Offset(-1, 0).Value = Range("e1").Value Range("b1").Select It starts at b10 which is a date, 21 jun. it runs down the column putting in the dates 22, 23, 24 June... until it gets to today's date, it stops by checking the cell e1 which contains the formula =today(). this works fine, however as the days go on and on its going to take longer and longer to run because it always starts at the beginning, 21 June in b10. Is there anyway to amend the code to force it to start at the max value in column b? Any help/comments appreciated. (note: i dont want to use formulae eg =if(b11today(),"",b10+1) because all cells below todays date have to be empty.) --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for all the help guys! i'm now sorted. cheers
-- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Optimizing mortage payback | Excel Worksheet Functions | |||
MapPoint Optimizing | Excel Discussion (Misc queries) | |||
optimizing a lookup | Excel Programming | |||
Optimizing an investment portfolio | Excel Programming | |||
Optimizing in VB | Excel Programming |