A complex vba issue (with codebar reader too...) (with pics)

_Fly_

Board Regular
Joined
Jan 6, 2012
Messages
87
Hello my friends.
I really need your help. I need to create to my job warehouse a simply inventory excel spreadsheet.
I have a laser code-bar reader attached to the computer on the warehouse.
I have created the follow spreadsheet

xwzdip.jpg


So i want to click on the "Procurar" button and appears a msgbox askme for the "Código I", I pick the code-bar reader pass on a codebar and the numbers appears on the msgbox i click ok on that msgbox and the program will search on the "Registos Globais" sheet by that "Código I" number.

Jv9JQQ.jpg


As you can see "Código I" appears on te A:A column at "Registos Globais" spreadsheet. If that codebar doesn't exists appears a msgbox telling "Esse número não existe!" and offer me the opportunity to give up or start a new search.
If that number exists like the "123456" on the image the program will copy the respective values to the fields on sheet "Saídas" (image 1) and fill the empy fields. Only the "Stock Final" and the "Valor Final" aren't to fill because i make a formula to calcule that, Also the "Quantidade Retirada" fields remains on black an the cursor appears automatic there, so the person inserts manually the number of items that he will take.
After inserts that and with the formula i will create (no help need) the person will click the "Inserir" button on image 1 and then the "Stock final" value will replace the "Stock Actual" value on sheet "Registos Globais", so the next time other person goes to pick tha item the final value appears updated.
It Shoud appears an advice if the "Stock Actual" on the "Registos Globais" sheet after pick that value becomes to zero it also be nice if appears an advice if the people wants "X" items but if the warehouse only have "Y" (Y The "Limpar" button its to clear all fields on the "Saídas" sheet.

Any ideas to the buttons code that can do that? I really, really appreciated that.

Regards
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
So please give an idea i have this code:

Private Sub botão_procurar_Click()

Dim FindString As String
Dim Rng As Range
FindString = InputBox("Insira o código de barras.")
If Trim(FindString) <> "" Then
With Sheets("Registos Globais").Range("A:A")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
.Copy Destination:=Sheets("Saídas").Range("f6")
Application.Goto Rng, True


Else
MsgBox "Código não encontrado!"
End If
End With
End If

End Sub

The msgbox appears and ask me the code after is inserted searches the value on the (A:A) on the "Registos Gerais" sheet and goes to that cell.
I don't need the program stops at that cell i want at a copy of the value discovered goes to the F6 cell on the "Saidas" and a copy of the value that appears on the correspondent cell on the C column goes to the F8 cell on the "Saidas" sheet and a copy of the value that appears on the column G appears on the J10 cell on the "Saidas".
I really need your help.
 
Upvote 0

Forum statistics

Threads
1,221,527
Messages
6,160,342
Members
451,638
Latest member
MyFlower

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top