I am looking for a macro that willl do the following:
* I have a date in cell A12
* I want to put that date in each cell of column b as long as the corresponding cell in column a has a number in it.
* After all dates are entered, I want the macro to skip two lines and start again, but this time add one day to the previous date.
Can someone help me on this?
I have attached a file here with a little more detail of what Im wanting to do.
Sub DateIncrement()
'
' DateIncrement Macro
' Macro recorded 13/05/2010 by Hannes
'
Dim EntDate As Date
Dim incCount As Integer
incCount = 3
EntDate = CDate(Cells(2, 3))
Do Until ActiveCell.Offset(incCount, -2).Value = ""
ActiveCell.Offset(incCount, -1).Value = DateAdd("d", 1, EntDate)
ActiveCell.Offset(0, 0).Select
incCount = incCount + 1
Loop
End Sub
Just need to put it into another outer loop. this is also assuming your spreadsheet is set up like mine.
Last edited by HanneSThEGreaT; June 14th, 2010 at 05:48 AM.
Re: [RESOLVED] need help writing macro in excel 2007
As I have stated excelboy, based on my example, you'd need to follow my example. Mine works perectly. Also, are you using a different Excel than 2003? That should have been stated propelry as well
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.