![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 364
|
I have a workbook named "Production Inventory". This workbook has a series of serial numbers in Column L and a series of PO#'s in column B. In my second workbook named "Master List", I have all of the serial numbers (from Production Inventory column L)listed in column B.
I need to grab the PO#'s from Production Inventory column B and match them to the appropriate serial numbers in Master List column B. The PO#'s will be deposited into column S on Master List. (BTW, the serial numbers on Master List are no longer in the order per Production Inventory). Any ideas? Thx, Noir |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Cape Town,South Africa
Posts: 234
|
Hello Noir
Look if this code will work for you Sub TotalValues() NxtVal: Total = 0 On Error GoTo NoVal 'The value is not in Column A A_Val = Application.InputBox("Value to Find in Column A") If A_Val = False Then Exit Sub B_Val = Range("A1:A6").Find(What:=A_Val, _ LookAt:=xlWhole).Offset(0, 1).Value On Error GoTo NoSpace 'The value in Column B does not contain a space StrippedVal = Left(B_Val, WorksheetFunction.Find(" ", B_Val) - 1) On Error GoTo NoSpaceInList 'Some values in list may not contain a space For Each thing In Range("B1:B6") If Left(thing.Value, WorksheetFunction.Find(" ", thing.Value) - 1) _ = StrippedVal Then Total = Total + Cells(thing.Row, 3) NoSpaceInList: Resume ChkAgn ChkAgn: Next GoTo Done NoSpace: StrippedVal = B_Val Total = Range("B1:B6").Find(What:=B_Val, _ LookAt:=xlWhole).Offset(0, 1).Value Resume Done Done: MsgBox "The Total For " & StrippedVal & " Is " & Total GoTo NxtVal NoVal: MsgBox "Sorry, That Value Is Not Listed" Resume NxtVal End Sub If it does not work for you,,,,,,mail me |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 364
|
Gareth,
Thanks for the code but, i am not familiar enough with code to be able to tell if i can use it or not. Noir |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Apr 2002
Location: Cape Town,South Africa
Posts: 234
|
Glad to be of assistance to you Noir
Just shout if you need more help |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Apr 2002
Location: Cape Town,South Africa
Posts: 234
|
Another thing Noir
Dont forget to manipulate the code so you can use it to fit in your worksheet (Need help) |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Apr 2002
Location: Cape Town,South Africa
Posts: 234
|
Another thing Noir
Dont forget to manipulate the code so you can use it to fit in your worksheet (Need help) |
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Apr 2002
Location: Cape Town,South Africa
Posts: 234
|
If you need to contact me my profile is on page 117 on top
That's where you will find my history Contact me please |
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Mar 2002
Posts: 364
|
Yes Gareth, i will definitely need help manipulating your code to my requirements.
Thx, Noir |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|