View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Howard Howard is offline
external usenet poster
 
Posts: 536
Default Object variable or with Block variable not set

On Thursday, October 3, 2013 1:36:24 AM UTC-7, Claus Busch wrote:
Hi Howard,



Am Thu, 3 Oct 2013 10:05:04 +0200 schrieb Claus Busch:



If Not rngFndPrd Is Nothing Then


rngFndPrd.Offset(0, 5).Copy


Sheets("Sheet1").Range("F100").End(xlUp).Offset(1, 0).PasteSpecial _


Paste:=xlPasteAll, Transpose:=False


End If




better without copy and paste:



Application.ScreenUpdating = False

For Each c In ws1Part_Num



Set rngFndPrd = ws2From_Item.Find(c, LookIn:=xlValues, _

lookat:=xlWhole)

If Not rngFndPrd Is Nothing Then

Sheets("Sheet1").Range("F100").End(xlUp)(2) _

= rngFndPrd.Offset(0, 5)

End If



Next

Application.ScreenUpdating = True





Regards

Claus B.



Aha, I did indeed change something like I said, it was the data I was using to test the code while I wrote it. Once it worked for me I changed the data a much larger data set and it had no match.

I like the non-copy paste you suggest. I'm sure its possible to include a Transpose or Values.

What would that look like?

Thanks Claus.