Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default If...Then Insert

Thanks A Million Tom

"Tom Ogilvy" wrote:

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

--
Regards,
Tom Ogilvy

"teresa" wrote in message
...
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







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot insert worksheet in exel - not available in insert menu pedro39 Excel Worksheet Functions 1 July 24th 08 12:09 PM
insert row / insert column command buttons fairgreen Excel Worksheet Functions 1 October 29th 07 02:41 PM
Can I auto insert a worksheet when I insert a value in a cell. iainc Excel Worksheet Functions 0 April 27th 06 08:37 AM
Insert Next? Or insert a variable number of records...how? Tom MacKay Excel Discussion (Misc queries) 0 April 20th 06 10:44 PM
Insert cell/format/text/fontsize and auto insert into header? Unfurltheflag Excel Programming 2 November 3rd 04 05:39 PM


All times are GMT +1. The time now is 04:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"