Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Barcode Scanner

Hi I have a question, I have fair knowledge of excel but I am trying to
build a userform which can be used as a interface with the database I have
created.
The trouble I am having is I have the following code to look up some
information and it gives me the item I am looking for. But if I use the
barcode scanner and scan the proper barcode on the item it does not
recognise it at all.

Why is this and how can I fix it thanks in advance

Greg B


Dim ansD3
Sheet1.Activate
On Error Resume Next
ansD3 = Application.Match(CLng(bcscan.value), Range("A:A"), 0)
If Not IsError(ansD3) Then
itembox.value = Application.Index(Range("b:b"), ansD3)
End If
On Error GoTo 0



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Barcode Scanner

Why use a worksheet function match when you can do it more eficiently in VBA

with sheets("Sheet1")
Data = CLng(bcscan.value)
set c = .Columns("A").find(what:=Data, _
lookin:=xlvalues, lookat:=xlwhole)
if not c is nothing then
itembox.value = c.offset(0,1)
end if
end with

"Greg B" wrote:

Hi I have a question, I have fair knowledge of excel but I am trying to
build a userform which can be used as a interface with the database I have
created.
The trouble I am having is I have the following code to look up some
information and it gives me the item I am looking for. But if I use the
barcode scanner and scan the proper barcode on the item it does not
recognise it at all.

Why is this and how can I fix it thanks in advance

Greg B


Dim ansD3
Sheet1.Activate
On Error Resume Next
ansD3 = Application.Match(CLng(bcscan.value), Range("A:A"), 0)
If Not IsError(ansD3) Then
itembox.value = Application.Index(Range("b:b"), ansD3)
End If
On Error GoTo 0




Reply
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
Barcode Scanner zac123 Excel Discussion (Misc queries) 0 May 29th 09 08:26 PM
Barcode scanner and quantities Brian Setting up and Configuration of Excel 5 December 12th 08 01:17 PM
barcode scanner and excel carolynj17 Excel Worksheet Functions 1 October 20th 08 10:22 PM
barcode scanner metallicadad38 Excel Discussion (Misc queries) 0 June 28th 06 08:34 PM
Barcode Scanner and macro question Johnsey[_6_] Excel Programming 1 November 9th 04 02:21 AM


All times are GMT +1. The time now is 10:46 PM.

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"