If...Then Insert

G

Guest

Hi, this is working fine, but there's a couple of lines (asterisked) which
aren't processing fine.i.e. doesn't seem to be pasting. Thanks

Sub jo()
Dim i As Variant
nCol = 2
'FMNoCol = nCol + 6
j = 1
On Error Resume Next
Application.DisplayAlerts = False
Worksheets("Client Marketing").Delete
Worksheets("No FM No").Delete
Application.DisplayAlerts = True
On Error GoTo 0
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name _
= "Client Marketing"
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name _
= "No FM No"
j = 1
k = 1
LastRow = Worksheets("Jobs 0104") _
.Cells(Rows.Count, nCol).End(xlUp).Row
For i = 2 To LastRow
If Left(Worksheets("Jobs 0104").Cells(i, nCol), 6) = "CLIENT" _
Or Left(Worksheets("Jobs 0104").Cells(i, nCol), 3) = "CMJ" Then


With Worksheets("Client Marketing")
* Worksheets("Jobs 0104").Cells(i, nCol).Copy Destination = .Cells(j, 1)
* j = j + 1
End With


Else
If Worksheets("Jobs 0104").Cells(i, 8) = 0 Then
Worksheets("Jobs 0104").Cells(i, nCol).Copy
Destination = Worksheets("No FM No").Cells(k, 1)
k = k + 1
End If
End If

Next
End Sub
 
T

Tom Ogilvy

There was/is a typo:
With Worksheets("Client Marketing")
* Worksheets("Jobs 0104").Cells(i, nCol).Copy Destination = .Cells(j, 1)
* j = j + 1
End With

Destination =
should be

Destination:=
with a colon then equal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top