Relri.Gomes
18-05-2022 12:02:18
Bom dia!
Senhores (as),
Sou iniciante em VBA, preciso de uma ajuda para resolver um problema de leitura de qrcode.
Fiz um código em VBA, mas não consegui associar o bip do coletor para executar o código.
Se poderem ajudar com esse problema.
Desde já agradeço a atenção.
Abaixo o código em VBA.
Sub gerado()
Dim lin, lin2
Dim w, w1 As Worksheet
Set w = Planilha1
Set w1 = Planilha2
lin2 = 2
lin = Cells(Rows.Count, 10).End(xlUp).Row + 1
Do While w.Cells(lin, 1).Value <> ""
Range("A" & lin).Select
Selection.TextToColumns Destination:=Range("A" & lin), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="ç", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, _
1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1)), TrailingMinusNumbers:=True
If w.Cells(lin, 9).Value <> "" Then
Cells(lin, 10).Value = "Gerado" & " - " & Now()
Cells(lin, 1).Select
Selection.NumberFormat = "0"
Cells(lin, 7).Select
Selection.NumberFormat = "dd/mm/yyy"
lin = lin + 1
End If
Loop
End Sub
Senhores (as),
Sou iniciante em VBA, preciso de uma ajuda para resolver um problema de leitura de qrcode.
Fiz um código em VBA, mas não consegui associar o bip do coletor para executar o código.
Se poderem ajudar com esse problema.
Desde já agradeço a atenção.
Abaixo o código em VBA.
Sub gerado()
Dim lin, lin2
Dim w, w1 As Worksheet
Set w = Planilha1
Set w1 = Planilha2
lin2 = 2
lin = Cells(Rows.Count, 10).End(xlUp).Row + 1
Do While w.Cells(lin, 1).Value <> ""
Range("A" & lin).Select
Selection.TextToColumns Destination:=Range("A" & lin), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="ç", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, _
1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1)), TrailingMinusNumbers:=True
If w.Cells(lin, 9).Value <> "" Then
Cells(lin, 10).Value = "Gerado" & " - " & Now()
Cells(lin, 1).Select
Selection.NumberFormat = "0"
Cells(lin, 7).Select
Selection.NumberFormat = "dd/mm/yyy"
lin = lin + 1
End If
Loop
End Sub