LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
creese
 
Posts: n/a
Default VBA Code help


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

 
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
code not unique find latest date Barbara Wiseman Excel Discussion (Misc queries) 3 December 11th 05 08:50 AM
VLOOKUP for Zip Code Ranges JerseyJR Excel Worksheet Functions 2 September 6th 05 06:37 PM
Conform a total to a list of results? xmaveric Excel Discussion (Misc queries) 1 August 21st 05 07:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
close form code tkaplan Excel Discussion (Misc queries) 1 June 3rd 05 10:49 PM


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