copying a range of cells from one worksheet to another
Initialise jnd to 1
--
HTH
RP
(remove nothere from the email address if mailing direct)
"David Gerstman" wrote in message
...
I've been trying to copy a range of cells based on the time column to
another
worksheet. The problem I have is with the
Worksheets(2).Cells(ind,1).select
line. I keep on getting a Runtime 1004 error (Application defined or
object
defined error). What is wrong with this code?
Dim date_range As Range
Set date_range = Sheets(1).Range("a2", Range("a2").End(xlDown))
.
.
For Each c In date_range
If c.Value = #6:07:01 PM# Then
Worksheets(2).Cells(ind, 1).Select
Range(select_range, select_range.End(xlToRight)).Select
Selection.Copy Destination:=Sheets(3).Cells(jind, 1)
jind = jind + 1
End If
If c.Value = #6:12:01 PM# Then Exit For
ind = ind + 1
Next c
Thanks,
David
|