russkie
10-20-2005, 10:48 AM
hello,
i have list i search for a barcode. Now when i have the barcode i can manipulate the information on that row. What i didnt expect, and now drives me mad, is that 2 different books by the same company have the same barcodes... schmucks...
So what i need is for my macro, when the user is scanning out a book, to check our list to make sure there isnt 2 copies of that barcode, if there is, present the user with more information on each barcode and ask him to pick which one he is sending out. Cool. so i got this:
With WS1.Range("B:B")
Set ItemCell = .Find(scanned, lookat:=xlWhole)
If Not ItemCell Is Nothing Then
Set RmmbrItem = ItemCell
Set ItemCell = .FindNext(ItemCell)
If Not ItemCell Is Nothing Then
pickone = InputBox("We have found 2 items with the same barcode: " & _
vbLf & vbLf & RmmbrItem.Offset(0, -1).Value & vbLf & _
ItemCell.Offset(0, -1).Value & vbLf & vbLf & _
"Please type in the Name of the book you wish to send.", "Oy!")
If (pickone = RmmbrItem.Offset(0, -1).Value) Then
Set ItemCell = RmmbrItem
GoTo CheckPrice
End If
If (pickone <> ItemCell.Offset(0, -1).Value) Then
MsgBox "You did not enter either of those, Restarting..."
GoTo GetBookInfo
End If
End If
GoTo CheckPrice
...
...
Ok, runs cool if 2 conditions are met:
1) there is a copy of that barcode
2)there is only one more copy of that barcode..
pretty junky conditions.
Sooo, when there is no copy of the barcode, itll present the user with 2 of the same item, same info and barcode, basically itll just loop the .FindNext and find the same item it did the first time, not cool, how do i get it not to do that?
Also, how can i get it to remember each item without "Dim"-ing a ton of preset Vars and looping it a billion times to check if there is more than one copy, meaning, i want it to (Dim "RmmbrItem" + 1 as range) on each loop, how do i do that? Or there is a better way?
Thanks alot for any help.
i have list i search for a barcode. Now when i have the barcode i can manipulate the information on that row. What i didnt expect, and now drives me mad, is that 2 different books by the same company have the same barcodes... schmucks...
So what i need is for my macro, when the user is scanning out a book, to check our list to make sure there isnt 2 copies of that barcode, if there is, present the user with more information on each barcode and ask him to pick which one he is sending out. Cool. so i got this:
With WS1.Range("B:B")
Set ItemCell = .Find(scanned, lookat:=xlWhole)
If Not ItemCell Is Nothing Then
Set RmmbrItem = ItemCell
Set ItemCell = .FindNext(ItemCell)
If Not ItemCell Is Nothing Then
pickone = InputBox("We have found 2 items with the same barcode: " & _
vbLf & vbLf & RmmbrItem.Offset(0, -1).Value & vbLf & _
ItemCell.Offset(0, -1).Value & vbLf & vbLf & _
"Please type in the Name of the book you wish to send.", "Oy!")
If (pickone = RmmbrItem.Offset(0, -1).Value) Then
Set ItemCell = RmmbrItem
GoTo CheckPrice
End If
If (pickone <> ItemCell.Offset(0, -1).Value) Then
MsgBox "You did not enter either of those, Restarting..."
GoTo GetBookInfo
End If
End If
GoTo CheckPrice
...
...
Ok, runs cool if 2 conditions are met:
1) there is a copy of that barcode
2)there is only one more copy of that barcode..
pretty junky conditions.
Sooo, when there is no copy of the barcode, itll present the user with 2 of the same item, same info and barcode, basically itll just loop the .FindNext and find the same item it did the first time, not cool, how do i get it not to do that?
Also, how can i get it to remember each item without "Dim"-ing a ton of preset Vars and looping it a billion times to check if there is more than one copy, meaning, i want it to (Dim "RmmbrItem" + 1 as range) on each loop, how do i do that? Or there is a better way?
Thanks alot for any help.