VBA Code:
Private Sub CommandButton1_Click()
Dim LastRow As Long, ws As Worksheet
If Not IsNumeric(TextBox1.Value) = Format(TextBox1.Value, "") = True Or TextBox1.Value = vbNullString Or Len(TextBox1.Value) <> 5 Then
MsgBox "ENTER 5 DIGIT ASSET TAG NUMBER"
Else
LastRow = Sheets("SCANNERS").Range("A" & Rows.Count).End(xlUp).Row + 1
With ActiveSheet
.Range("A" & LastRow).Value = TextBox1
.Range("C" & LastRow).Value = TextBox2
End With
End If
End Sub
Using the above VBA it seems to place the value in textbox1 as a text value and not number.
because in cell B I have the Following formula:
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2 | B2 | =IFERROR(INDEX(INV!$B$2:$B$1001,MATCH(A2,INV!$A$2:$A$1001,0)),"") |
Defective Scanner Tracker.xlsm | ||||
---|---|---|---|---|
A | B | |||
1 | BARCODE# | SERIAL NUMBER | ||
2 | 13383 | S20312522501204 | ||
3 | 13204 | S19266522500480 | ||
INV |
so if textbox 1 is 13204 and its placed in column "A" the Seral number does not appear until after I double click the cell and hit enter. any suggestions with this.