View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joel[_97_] joel[_97_] is offline
external usenet poster
 
Posts: 1
Default Find & copy values below dates


Try this


Sub MoveDates()

StartDate = DateValue("1/7/09")
EndDate = DateValue("12/12/09")

NewCol = 4 'column D
With Sheets("sheet2")
LastCol = .Cells(12, Columns.Count).End(xlToLeft).Column
For ColCount = 3 To LastCol
If IsDate(.Cells(12, ColCount)) Then
MyDate = .Cells(12, ColCount).Value
If MyDate = StartDate And _
MyDate <= EndDate Then

Data = .Cells(13, ColCount)
With Sheets("Scenarios")
..Cells(6, NewCol) = Data
NewCol = NewCol + 1
End With
End If

End If

Next ColCount

End With




End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=147824