Thread: VBA Code help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach
 
Posts: n/a
Default VBA Code help

What is "look up tool"? Is it the macro you posted? It is not clear what
you are asking for from what you posted. Please post back and provide a
step-by-step procedure of what you want this macro to do, as written. Then
provide another step-by-step procedure of what you want this macro to do
after it is changed. HTH Otto
"creese" wrote in
message ...

I have a inventory spreadsheet that I load serial numbers on and on
sheet 1 I have look up tool. I need some help so I can create seperate
pages for each item, and have my lookup tool search through each page.
Currently it only looks up on the one page. Ok Here is my code I have
now:

Sub UpdateReceipt()
SerialFound = "NotYet"
myError = ""
Range("b1").Clear
mySerial = Range("b2").Value
myReceipt = Range("b3").Value
Sheets("Sheet2").Select
Range("c1").Select
Do While Selection.Value < ""
Selection.Offset(1, 0).Select
If Selection.Value = mySerial Then
If IsEmpty(Selection.Offset(0, 1).Value) Then
Selection.Offset(0, 1).Value = myReceipt
SerialFound = "Yes"
myError = "Updated Successfully"
Else
myError = "Error, Receipt Exists for that Serial #"
SerialFound = "No"
End If
End If
Loop
If SerialFound = "NotYet" Then myError = "Serial Number not found"
Sheets("Sheet1").Select
Range("b1").Value = myError
If SerialFound = True Then
Range("b3").Clear
End If

End Sub


--
creese
------------------------------------------------------------------------
creese's Profile:
http://www.excelforum.com/member.php...o&userid=35508
View this thread: http://www.excelforum.com/showthread...hreadid=554590