Peter
What is "it didn't work"? Nothing happened? Error message? Wrong rows
copied?
Works fine for me. Finds all rows in column A with data over 10 and copies
those rows to a new worksheet named CopyData.
The code would be placed in a General Module, not worksheet or ThisWorkbook.
Gord Dibben Excel MVP
On Mon, 10 Jan 2005 08:25:06 -0800, Peter Curtis
wrote:
Hi Bob
Thanks for the reply. Unfortunately it didn't work, I would assume I need to
simplify it some how?
Regards,
Peter
"Bob Phillips" wrote:
This might need some clarification
Sub CopyData()
Dim ws As Worksheet
Dim cLastRow As Long
Dim i As Long
Dim j As Long
Set ws = ActiveSheet
cLastRow = ws.Cells(Rows.Count, "A").End(xlUp).Row
On Error Resume Next
Worksheets.Add.Name = "CopyData"
Worksheets("CopyData").ClearContents
On Error GoTo 0
j = 1
For i = 1 To cLastRow
If ws.Cells(i, "A").Value 10 Then
ws.Cells(i, "A").EntireRow.Copy _
Destination:=Worksheets("CopyData").Cells(j, "A")
j = j + 1
End If
Next i
End Sub
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Peter Curtis" wrote in message
...
Can anyone help with this problem, I would like a formula to read a column
and any entries over a certain number e.g. 10 it copies the information
onto
a new worksheet.
Many thanks!
|