Need simple VBA to change cell value or display a message

A

Alexis

We are doing stocktake with a wireless scanner and excel spreadsheet. The plan is to have a VBA input box which upon input checks a column of barcodes for a match and adds +1 to the value of a cell to the right of the barcode and automatically restart the script. If no match - play a sound and error message.

Is that hard to do, where can we ask for help on this matter?

Thank you!
 
I

isabelle

hi,

if the result of scanning is put in cell A1 and the value of this research is to be found in column B
i suggest you add a formula on the sheet to activate the event "Calculate"
like: =Match(A1,B:B,0)
and then copy the following macro on this VBAProject activesheet

Private Sub Worksheet_Calculate()
Dim oRow
oRow = Application.Match(Range("A1"), Range("B:B"), 0)
If Not IsError(oRow) Then
Range("C1") = Range("C1").Value + 1
Else
MsgBox " The value was not found"
End If
End Sub




--
isabelle




Le 2012-06-08 10:54, Alexis a écrit :
We are doing stocktake with a wireless scanner and excel spreadsheet.

The plan is to have a VBA input box which upon input checks a column of barcodes for a match and adds +1

to the value of a cell to the right of the barcode and automatically restart the script. If no match - play a sound and error message.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top