LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Sorting question


I have a chart I am trying to update with several sheets that contain
serial #'s. Each sheet has a different item with different serial #'s.
On sheet one I have a lookup tool that I type in the serial # and
receipt # and it will put the receipt # by the correct serial # in the
chart. Problem is I can only do it with one sheet, I can't figure out
how to make it look through several sheets to find the correct serial,
it will only look on sheet 2. any ideas would be greatly appreciated.

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=554707

 
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
Sorting Question Jennifer Excel Discussion (Misc queries) 0 April 14th 08 10:11 PM
Sorting Question Freshman Excel Worksheet Functions 11 August 8th 07 03:33 PM
Sorting question blueglass74 Excel Discussion (Misc queries) 2 February 23rd 06 12:34 AM
Sorting Question Tim Excel Discussion (Misc queries) 1 April 7th 05 04:57 PM
sorting question Brian Excel Worksheet Functions 5 November 30th 04 05:32 AM


All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"