Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Create a Macro that help paste the lot#

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Create a Macro that help paste the lot#

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
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
Create WB, create new Sht, paste data. (Macro not working) Rick S. Excel Programming 6 October 31st 07 05:33 PM
I need formula help or create a macro to copy and paste value only Rebecca Excel Discussion (Misc queries) 4 April 8th 06 01:18 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 Excel Programming 1 October 17th 05 08:56 AM
Macro cut and paste quits, can't re-create NM Burton Excel Programming 1 November 24th 04 06:04 PM
Create an undoable 'paste formula' macro Luc[_5_] Excel Programming 2 June 11th 04 12:12 PM


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

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

About Us

"It's about Microsoft Excel"