Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fill FromDate to ToDate
Chuck
Try the following macro (stick it in a standard module in the workbook concerned and hit run): Sub Test() Dim d1 As Long, d2 As Long, rng As Range, i As Long With Sheets("Sheet1") d1 = .Range("FromDate") d2 = .Range("ToDate") End With If d1 <= d2 Then With Sheets("Sheet2") .Activate .Range("H8:H" & .Range("H65536").End(xlUp).Row).ClearContents .Range("H8").Activate For i = d1 To d2 Step 1 Set rng = ActiveCell rng.Value = i ActiveCell.Offset(1, 0).Activate Next .Range("H8:H" & .Range("H65536").End(xlUp).Row).NumberFormat = "ddmmmyyyy" End With End If End Sub Hope it helps! Richard CLR wrote: Hi All........ I need some help, if someone please. I have a cell Sheet1I4 named "FromDate" and another Sheet1J4 named "ToDate". I would like to put "FromDate" in Sheet2H8 and fill down column H until the value in "ToDate" is reached......it may be only a few days, or several months, depending on the dates set in by the user. I've tried recording the macro, but of course that don't work for beans.......any help would be much appreciated. Vaya con Dios, Chuck, CABGx3 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
what is the alternative for PlotArea.Fill. Fill property is hidden | New Users to Excel | |||
Erase fill print then bring fill back | Excel Discussion (Misc queries) | |||
Fill in form to type Item descrictions and costs and fill in funct | Excel Worksheet Functions | |||
I have a list of data, fill in the gaps. FILL function won't work | Excel Discussion (Misc queries) | |||
The fill feature in Excel that gives option to fill or copy | New Users to Excel |