Small equipment in and out with barcodes in Excel
Free templates and templates with code are available for purchase for $50 USD
www.easyexcela...
Addition Templates may be available on request
Click this link to check out my one-on-one training www.calendly.co...
For more help visit my website www.easyexcelanswers.com or email me at easyexcelanswers@gmail.com.
Contact me regarding customizing this template for your needs.
Click for online Excel Consulting www.calendly.co...
Are you struggling to update your Microsoft SQL Server data?
I recommend using well-known Excel to update and manage your data in SQL Server using the SQL Spreads Excel add-in.
Click sqlspreads.com... to find out how SQL Spreads works best for non-technical end users and download our free 14-day trial. You will get two months free when purchasing an annual subscription using our link.
I am able to provide online help on your computer at a reasonable rate.
Check out Crowdcast for creating your webinars
app.linkmink.c...
I use Tube Buddy to help promote my videos
Check them out
www.Tubebuddy....
Follow me on Facebook
/ easyexcel.answers
IG @barbhendersonconsulting
You can help and generate a translation to you own language
www.youtube.com...
Option Explicit
Sub toolsout()
Dim barcode As String
Dim rng, rng1 As Range
Dim rownumber As Long
barcode = ActiveSheet.Cells(2, 1)
If barcode = "" Then Exit Sub
If barcode not equal to "" Then
'search for barcode
Set rng = Sheet1.Columns("b:b").Find(What:=barcode, _
LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
If rng Is Nothing Then
restart:
Sheet1.Columns("b:b").Find("").Select
'check that there is a user
If ActiveCell.Offset(0, -1).Value = "" Then
MsgBox "id must be scanned in first"
ActiveSheet.Cells(2, 1) = ""
GoTo ende
End If
ActiveCell.Value = barcode
rownumber = ActiveCell.Row
ActiveCell.NumberFormat = "@"
Call finddesc(barcode, rownumber) 'call the other sub to get desc
Sheet1.Cells(rownumber, 4).Select
ActiveCell.Value = Date & " " & Time
ActiveCell.NumberFormat = "m/d/yyyy h:mm AM/PM"
Sheet1.Cells(2, 1) = ""
GoTo ende
Else
rownumber = rng.Row
If Cells(rownumber, 5) not equal to "" Then GoTo restart 'check for being returned
ActiveSheet.Cells(rownumber, 5).Select
ActiveCell.Value = Date & " " & Time
ActiveCell.NumberFormat = "m/d/yyyy h:mm AM/PM"
Sheet1.Cells(2, 2) = ""
End If
End If
ende:
Sheet1.Cells(2, 1) = ""
Sheet1.Cells(2, 1).Select
End Sub
Sub finddesc(barcode, rownumber)
Dim rng, rown As Long
Dim desc As String
Set rng = Sheet2.Columns("a:a").Find(What:=barcode, _
LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
If rng Is Nothing Then
MsgBox "equipment not found"
Else
rown = rng.Row
desc = Sheet2.Cells(rown, 2).Value
Sheet1.Cells(rownumber, 3).Value = desc
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("A2")) Is Nothing Then
Call toolsout
Application.EnableEvents = True
End If
End Sub
*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I've used or have experience with.
How to insert VBA code in Excel • How to insert VBA code...
11 сен 2024