Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default 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
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
what is the alternative for PlotArea.Fill. Fill property is hidden srinivas Tirumala[_2_] New Users to Excel 1 September 4th 09 09:36 PM
Erase fill print then bring fill back Homer Excel Discussion (Misc queries) 5 September 26th 07 01:50 PM
Fill in form to type Item descrictions and costs and fill in funct cradino Excel Worksheet Functions 0 July 16th 06 08:44 PM
I have a list of data, fill in the gaps. FILL function won't work Triv Excel Discussion (Misc queries) 1 September 17th 05 02:33 PM
The fill feature in Excel that gives option to fill or copy KAHelman New Users to Excel 1 July 29th 05 07:47 PM


All times are GMT +1. The time now is 06:22 AM.

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

About Us

"It's about Microsoft Excel"