Thread: copy/paste VBA
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
kiat kiat is offline
external usenet poster
 
Posts: 34
Default copy/paste VBA

Dim xC As Range, xDate As Date, xRows As String
xDate = "22 August 2003"
For Each xC In ActiveSheet.Range("date")
If xC.Value = xDate Then xRows = xRows & "," & xC.Row & ":" & xC.Row
Next
If Len(xRows) Then
xRows = Mid$(xRows, 2)
ActiveSheet.Range(xRows).Copy
Destination:=Worksheets("Sheet2").Range("A1")
End If


"matt" wrote in message
...
I am trying to write code that will search a sheet and
select all of the rows that contain a certain date. Then
I want to copy/paste all of the rows onto a different
sheet.
I am having some trouble with this, please help!
Matt