View Single Post
  #5   Report Post  
Peter Curtis
 
Posts: n/a
Default

Hi Bob,

I haven't used VBA much, the error I get is a compile error, expected end sub

Any ideas?

Many thanks for your help

"Bob Phillips" wrote:

Peter,

There were not enough details really, so I made some guesses.

Tell me how it doesn't work, what it should do.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Peter Curtis" wrote in message
...
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!