Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Would "lookup" work for this?

I have 2 sheets with similar data. Both are for orders placed by the
customer. But both sheets have different part numbers as well as the same
part numbers. What I am trying to do is pull from sheet 2 all the part number
orders and place on sheet 1.

For example Sheet 1:

Part No. 6/17 6/24 6/30
12334 2 4 3
12335 3 4 2
12337 2 2 0
18494 1 1 1

Sheet 2

Part No. 6/17 6/24 6/30
12331 1 1 1
12334 7 2 2
12337 2 8 4
17854 1 2 4


Would like to have the number of orders needed from sheet 2 sent to sheet 1,
appending them at the end of the columns with dates.

Part No. 6/17 6/24 6/30 6/17 6/24 6/30
12334 2 4 3 7 2
2
12335 3 4 2
12337 2 2 0 2 8
4
18494 1 1 1

Any help is most appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Would "lookup" work for this?

Try this

Sub CombineSheets()

With Sheets("Sheet1")
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
NewRow = LastRow + 1
Sh1LastCol = .Cells(1, Columns.Count).End(xlToLeft).Column
Sh1NewCol = Sh1LastCol + 1
End With
With Sheets("Sheet2")
Sh2LastCol = .Cells(1, Columns.Count).End(xlToLeft).Column
.Range(.Range("B1"), .Cells(1, Sh2LastCol)).Copy _
Destination:=Sheets("Sheet1").Cells(1, Sh1NewCol)
RowCount = 2
Do While .Range("A" & RowCount) < ""
PartNo = .Range("A" & RowCount)
Set CopyRange = .Range(.Cells(RowCount, "B"), _
.Cells(RowCount, Sh2LastCol))
With Sheets("Sheet1")
Set c = .Columns("A").Find(what:=PartNo, _
LookIn:=xlValues, lookat:=xlWhole)
If c Is Nothing Then
.Range("A" & NewRow) = PartNo
CopyRange.Copy Destination:=.Cells(NewRow, Sh1NewCol)
NewRow = NewRow + 1
Else
CopyRange.Copy Destination:=.Cells(c.Row, Sh1NewCol)
End If
End With
RowCount = RowCount + 1
Loop
End With


End Sub

"Randy L" wrote:

I have 2 sheets with similar data. Both are for orders placed by the
customer. But both sheets have different part numbers as well as the same
part numbers. What I am trying to do is pull from sheet 2 all the part number
orders and place on sheet 1.

For example Sheet 1:

Part No. 6/17 6/24 6/30
12334 2 4 3
12335 3 4 2
12337 2 2 0
18494 1 1 1

Sheet 2

Part No. 6/17 6/24 6/30
12331 1 1 1
12334 7 2 2
12337 2 8 4
17854 1 2 4


Would like to have the number of orders needed from sheet 2 sent to sheet 1,
appending them at the end of the columns with dates.

Part No. 6/17 6/24 6/30 6/17 6/24 6/30
12334 2 4 3 7 2
2
12335 3 4 2
12337 2 2 0 2 8
4
18494 1 1 1

Any help is most appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.misc
Don Don is offline
external usenet poster
 
Posts: 487
Default Would "lookup" work for this?

I would try a vlookup command. You can also create another sheet and put
both of them together (if the columns are the same) adding a new column to
identify each group , then do a pivot table

Data
Part No. location 6/17 6/24 6/30
12331 sheet2 1 1 1
12334 Sheet1 2 4 3
sheet2 7 2 2
12335 Sheet1 3 4 2
12337 Sheet1 2 2 0
sheet2 2 8 4
17854 sheet2 1 2 4
18494 Sheet1 1 1 1
Grand Total 19 24 17


"Randy L" wrote:

I have 2 sheets with similar data. Both are for orders placed by the
customer. But both sheets have different part numbers as well as the same
part numbers. What I am trying to do is pull from sheet 2 all the part number
orders and place on sheet 1.

For example Sheet 1:

Part No. 6/17 6/24 6/30
12334 2 4 3
12335 3 4 2
12337 2 2 0
18494 1 1 1

Sheet 2

Part No. 6/17 6/24 6/30
12331 1 1 1
12334 7 2 2
12337 2 8 4
17854 1 2 4


Would like to have the number of orders needed from sheet 2 sent to sheet 1,
appending them at the end of the columns with dates.

Part No. 6/17 6/24 6/30 6/17 6/24 6/30
12334 2 4 3 7 2
2
12335 3 4 2
12337 2 2 0 2 8
4
18494 1 1 1

Any help is most appreciated.

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
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Lookup using 2 cells as the "X" and "Y" coordinates.... kcsims Excel Worksheet Functions 1 December 15th 06 09:06 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
pictures to work with "data" "sort" option arad Excel Discussion (Misc queries) 1 April 18th 06 09:15 PM


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

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"