0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Excel VBA バーコードリーダーの情報をエクセルに書き出す

Posted at

はじめに

バーコードリーダーの情報をエクセルシートへ書き出しを行う

プロシジャーの説明

任意のバーコードをスキャンして、A列の1行目から順に読み込みます

サンプル1

Sub ReadBarcode()
    Dim LastRow As Long
    Dim BarcodeValue As String
    
    ' A列の最終行を取得
    LastRow = Cells(Rows.Count, 1).End(xlUp).Row
    
    ' バーコード値を取得するための入力ボックスを表示
    BarcodeValue = InputBox("バーコードをスキャンしてください:", "バーコードスキャン")
    
    ' キャンセルが押された場合は処理を終了
    If BarcodeValue = "" Then Exit Sub
    
    ' A列の最終行の次のセルにバーコード値を入力
    Cells(LastRow + 1, 1).Value = BarcodeValue
End Sub
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?