Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default index/match type issue

I am creating an order page that has Columns A (Department), B (Part Number),
C (Quantity), and D (Need By Date). The Worksheet name is "Order". What I'm
trying to do is retrieve the information in Column B and do an Index/Match
type function on Worksheet "Cut List". The cut list page has a list of 1922
parts that our Laser cuts. The part number in row B on the Order page needs
to search Column E on the Cut List page. Once the part numbers are matched I
would like Column A's value in "Order" to be the new value in Column A on the
"Cut List" page and so on. I need this process to continue on until all
parts on the "Order" page have been accounted for.

I'm looking in the books I have for something similar that I can adjust but
I'm only finding how to copy ranges from one worksheet to the other.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default index/match type issue

Try this

Sub correctPN()

With Sheets("Order")
RowCount = 2
Do While .Range("B" & RowCount) < ""
PartNo = .Range("B" & RowCount)

With Sheets("Cut List")
Set c = .Columns("E").Find(what:=PartNo, _
LookIn:=xlValues, lookat:=xlWhole)
End With

If c Is Nothing Then
MsgBox ("Cannot find Part : " & PartNo)
.Range("A" & RowCount) = "Cannot Find Dept"
Else
Dept = c.Value
.Range("A" & RowCount) = Dept
End If
RowCount = RowCount + 1
Loop

End With

End Sub


"Cerberus" wrote:

I am creating an order page that has Columns A (Department), B (Part Number),
C (Quantity), and D (Need By Date). The Worksheet name is "Order". What I'm
trying to do is retrieve the information in Column B and do an Index/Match
type function on Worksheet "Cut List". The cut list page has a list of 1922
parts that our Laser cuts. The part number in row B on the Order page needs
to search Column E on the Cut List page. Once the part numbers are matched I
would like Column A's value in "Order" to be the new value in Column A on the
"Cut List" page and so on. I need this process to continue on until all
parts on the "Order" page have been accounted for.

I'm looking in the books I have for something similar that I can adjust but
I'm only finding how to copy ranges from one worksheet to the other.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default index/match type issue

Thank you for your assistance Joel. I have a question about one part. What
is the LookIn:=xlValues, lookat:=xlWhole part referencing?

"Joel" wrote:

Try this

Sub correctPN()

With Sheets("Order")
RowCount = 2
Do While .Range("B" & RowCount) < ""
PartNo = .Range("B" & RowCount)

With Sheets("Cut List")
Set c = .Columns("E").Find(what:=PartNo, _
LookIn:=xlValues, lookat:=xlWhole)
End With

If c Is Nothing Then
MsgBox ("Cannot find Part : " & PartNo)
.Range("A" & RowCount) = "Cannot Find Dept"
Else
Dept = c.Value
.Range("A" & RowCount) = Dept
End If
RowCount = RowCount + 1
Loop

End With

End Sub


"Cerberus" wrote:

I am creating an order page that has Columns A (Department), B (Part Number),
C (Quantity), and D (Need By Date). The Worksheet name is "Order". What I'm
trying to do is retrieve the information in Column B and do an Index/Match
type function on Worksheet "Cut List". The cut list page has a list of 1922
parts that our Laser cuts. The part number in row B on the Order page needs
to search Column E on the Cut List page. Once the part numbers are matched I
would like Column A's value in "Order" to be the new value in Column A on the
"Cut List" page and so on. I need this process to continue on until all
parts on the "Order" page have been accounted for.

I'm looking in the books I have for something similar that I can adjust but
I'm only finding how to copy ranges from one worksheet to the other.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default index/match type issue

lookin is specifying you are look at the values in the cells. It could be
values, formuls, or comments.

lookat can be either whole or part.

"Cerberus" wrote:

Thank you for your assistance Joel. I have a question about one part. What
is the LookIn:=xlValues, lookat:=xlWhole part referencing?

"Joel" wrote:

Try this

Sub correctPN()

With Sheets("Order")
RowCount = 2
Do While .Range("B" & RowCount) < ""
PartNo = .Range("B" & RowCount)

With Sheets("Cut List")
Set c = .Columns("E").Find(what:=PartNo, _
LookIn:=xlValues, lookat:=xlWhole)
End With

If c Is Nothing Then
MsgBox ("Cannot find Part : " & PartNo)
.Range("A" & RowCount) = "Cannot Find Dept"
Else
Dept = c.Value
.Range("A" & RowCount) = Dept
End If
RowCount = RowCount + 1
Loop

End With

End Sub


"Cerberus" wrote:

I am creating an order page that has Columns A (Department), B (Part Number),
C (Quantity), and D (Need By Date). The Worksheet name is "Order". What I'm
trying to do is retrieve the information in Column B and do an Index/Match
type function on Worksheet "Cut List". The cut list page has a list of 1922
parts that our Laser cuts. The part number in row B on the Order page needs
to search Column E on the Cut List page. Once the part numbers are matched I
would like Column A's value in "Order" to be the new value in Column A on the
"Cut List" page and so on. I need this process to continue on until all
parts on the "Order" page have been accounted for.

I'm looking in the books I have for something similar that I can adjust but
I'm only finding how to copy ranges from one worksheet to the other.

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
A vlookup/index-match type problem Andrew Mackenzie Excel Discussion (Misc queries) 10 October 24th 09 10:24 AM
IF AND MATCH data type issue EZ[_2_] Excel Worksheet Functions 2 June 18th 09 05:35 PM
MATCH & INDEX ISSUE? [email protected] Excel Discussion (Misc queries) 1 March 15th 08 03:13 AM
index match issue StephenAccountant Excel Worksheet Functions 2 December 14th 07 03:49 AM


All times are GMT +1. The time now is 11:55 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"