![]() |
Need help with loop
I have a worksheet with several thousand retail items listed wit Description, Product Barcode, price, etc. In cell J10, I want to scan in a barcode from a product. any product. I then want to search the data to find a matching barcode and retur the description and the price of that item. I have accomplished thi by using the following formulas: =VLOOKUP(J10,A2:C24890,2,FALSE) Returns description from column 2 and =VLOOKUP(J10,A2:C24890,3,FALSE) Returns price from column 3. Now I need for the cursor to automatically return to J10 so I can sca in the next product barcode. The scanner that I am using enters the 10 digit barcode number in th cell where I have my cursor, then automatically goes to the cell to th right. How do I set this up to return to the original cell (J10) to ge ready for the next barcode. Please help. I know that the answer is probably very obvious - I a just looking over it -- Lane ----------------------------------------------------------------------- Lane4's Profile: http://www.excelforum.com/member.php...fo&userid=2817 View this thread: http://www.excelforum.com/showthread.php?threadid=47702 |
Need help with loop
right click on the sheet name and choose view code
paste this on the sheet code page if k10 is selected, it should take you back to j10 Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count = 1 Then If Not Intersect(Target, Range("K10")) Is Nothing Then Worksheets(1).Range("J10").Select End If End If End Sub -- Gary "Lane4" wrote in message ... I have a worksheet with several thousand retail items listed with Description, Product Barcode, price, etc. In cell J10, I want to scan in a barcode from a product. any product. I then want to search the data to find a matching barcode and return the description and the price of that item. I have accomplished this by using the following formulas: =VLOOKUP(J10,A2:C24890,2,FALSE) Returns description from column 2 and =VLOOKUP(J10,A2:C24890,3,FALSE) Returns price from column 3. Now I need for the cursor to automatically return to J10 so I can scan in the next product barcode. The scanner that I am using enters the 10 digit barcode number in the cell where I have my cursor, then automatically goes to the cell to the right. How do I set this up to return to the original cell (J10) to get ready for the next barcode. Please help. I know that the answer is probably very obvious - I am just looking over it. -- Lane4 ------------------------------------------------------------------------ Lane4's Profile: http://www.excelforum.com/member.php...o&userid=28173 View this thread: http://www.excelforum.com/showthread...hreadid=477028 |
Need help with loop
Tools=Options=Edit Tab
Uncheck "Move selection after Enter" -- Regards, Tom Ogilvy "Lane4" wrote in message ... I have a worksheet with several thousand retail items listed with Description, Product Barcode, price, etc. In cell J10, I want to scan in a barcode from a product. any product. I then want to search the data to find a matching barcode and return the description and the price of that item. I have accomplished this by using the following formulas: =VLOOKUP(J10,A2:C24890,2,FALSE) Returns description from column 2 and =VLOOKUP(J10,A2:C24890,3,FALSE) Returns price from column 3. Now I need for the cursor to automatically return to J10 so I can scan in the next product barcode. The scanner that I am using enters the 10 digit barcode number in the cell where I have my cursor, then automatically goes to the cell to the right. How do I set this up to return to the original cell (J10) to get ready for the next barcode. Please help. I know that the answer is probably very obvious - I am just looking over it. -- Lane4 ------------------------------------------------------------------------ Lane4's Profile: http://www.excelforum.com/member.php...o&userid=28173 View this thread: http://www.excelforum.com/showthread...hreadid=477028 |
All times are GMT +1. The time now is 01:58 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com