สิ่งที่ต้องการ
- อยากให้เวลาสแกนมีเสียงครับคืออยากให้เวลาข้อมูลบันทึกมีเสียงครับ
- เวลาไม่มีข้อมูลอยากให้ขึ้นอีกเสียงครับ
Code: Select all
Private Sub TextBox5_AfterUpdate()
Dim SoundFile As String, rc As Long
SoundFile = "C:\Users\Administrator\Downloads\A_Drum.wav"
With Workbooks("DataX.xlsx").Worksheets("Sheet1")
Set rngVlp = .Range("a2", .Range("d" & .Rows.Count).End(xlUp))
If Me.TextBox5.Text = "" Then Exit Sub
If WorksheetFunction.CountIf(Workbooks("DataX.xlsx").Worksheets("Sheet1").Range("A:D"), Me.TextBox5.Value) = 0 Then
'Me.TextBox5.Value = ""
MsgBox "Not found."
Exit Sub
End If
Me.TextBox6.Text = Application.VLookup(CLng(Me.TextBox5.Text), rngVlp, 2, 0)
Me.TextBox7.Text = Application.VLookup(CLng(Me.TextBox5.Text), rngVlp, 3, 0)
Me.TextBox8.Text = Application.VLookup(CLng(Me.TextBox5.Text), rngVlp, 4, 0)
End With
With ThisWorkbook.Worksheets("IN")
emptyrow = .Range("a" & .Rows.Count).End(xlUp).Offset(1, 0).Row
End With
With Worksheets("IN")
.Cells(emptyrow, 1).Value = TextBox1.Value
.Cells(emptyrow, 2).Value = TextBox2.Value
.Cells(emptyrow, 3).Value = TextBox4.Value
.Cells(emptyrow, 4).Value = ComboBox1.Value
.Cells(emptyrow, 5).Value = TextBox5.Value
.Cells(emptyrow, 6).Value = TextBox6.Value
.Cells(emptyrow, 7).Value = TextBox7.Value
.Cells(emptyrow, 8).Value = TextBox8.Value
.Cells(emptyrow, 9).Value = TextBox9.Value
End With
End Sub
You do not have the required permissions to view the files attached to this post.