PC Review


Reply
Thread Tools Rate Thread

Create a Macro that help paste the lot#

 
 
Lawrence
Guest
Posts: n/a
 
      24th Jul 2009
Hi all Gurus,

I have 3 worksheets namely

1) Receiving Unit by Lot# worsheet
2) Shipout unit by Lot# worksheet
3) XXX worksheet

All 3 worksheets contain 2 column titles

Lot #
Total Quantity

i want to create a Macro that help paste the lot#, not found in "Receiving
unit worsheet" but found in "Shipout unit worksheet" in "XXX worksheet".

Thanks
Lawrence
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      24th Jul 2009
I made the ID column A. Change as required


Sub FindMissingData()

Const ID_Col = "A"

Set RcvSht = Sheets("Receiving Unit by Lot#")
Set ShipSht = Sheets("Shipout unit by Lot#")
Set TmpSht = Sheets("XXX")

TmpSht.Cells.ClearContents
'copy header row from Shipped shat to Temp Sht
ShipSht.Rows(1).Copy _
Destination:=TmpSht.Rows(1)


TmpRow = 2
RowCount = 2
With ShipSht
Do While .Range(ID_Col & RowCount) <> ""
ID = .Range(ID_Col & RowCount)

Set c = RcvSht.Columns(ID_Col).Find(what:=ID, _
LookIn:=xlValues, lookat:=xlWhole)

If c Is Nothing Then
.Rows(c.Row).Copy _
Destination:=TmpSht.Rows(TmpRow)

TmpRow = TmpRow + 1
End If

RowCount = RowCount + 1
Loop


End With


End Sub


"Lawrence" wrote:

> Hi all Gurus,
>
> I have 3 worksheets namely
>
> 1) Receiving Unit by Lot# worsheet
> 2) Shipout unit by Lot# worksheet
> 3) XXX worksheet
>
> All 3 worksheets contain 2 column titles
>
> Lot #
> Total Quantity
>
> i want to create a Macro that help paste the lot#, not found in "Receiving
> unit worsheet" but found in "Shipout unit worksheet" in "XXX worksheet".
>
> Thanks
> Lawrence

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create WB, create new Sht, paste data. (Macro not working) =?Utf-8?B?UmljayBTLg==?= Microsoft Excel Programming 6 31st Oct 2007 05:33 PM
Trying to create a macro in ppt to paste as picture! Heather O'Malley Microsoft Powerpoint 1 15th Mar 2006 02:04 PM
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro Steven Microsoft Excel Programming 1 17th Oct 2005 08:56 AM
Macro cut and paste quits, can't re-create NM Burton Microsoft Excel Programming 1 24th Nov 2004 06:04 PM
Create Copy and Paste macro ljCharlie Microsoft Outlook VBA Programming 0 5th Dec 2003 01:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:29 AM.