How to Prevent Excel from Changing Scanned Barcode Values
Question details
The user needs a method to prevent spreadsheet software from automatically converting scanned barcode inputs into decimal values or numbers with stripped leading zeros.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Scanning barcodes directly into a spreadsheet using a hardware barcode scanner to track inventory or assets.
- Observed behavior
- Excel interprets the scanned barcode text as a standard number, automatically converting it to scientific notation or removing critical leading zeros.
Ensure your barcode scanner is properly connected to your computer and verify that it is configured to act as a standard keyboard emulator.
Format Destination Cells as Text Before Scanning
Changing the cell format to Text forces the spreadsheet to accept the exact characters scanned, preserving all leading zeros and preventing scientific notation.
By default, Excel assumes any input containing only digits is a mathematical number. To store long barcode strings and keep their exact formatting (like leading zeros), you must tell Excel to treat the incoming data purely as text before you begin scanning.
Highlight the column or specific range of cells where you plan to scan the barcode data.
Right-click the highlighted selection and choose 'Format Cells' from the context menu.
Navigate to the 'Number' tab, select 'Text' from the Category list, and click 'OK'.
Click on the first formatted cell and begin scanning your barcodes. The values will now appear exactly as printed on the label.

Use an Apostrophe Prefix for Manual Entries
If you are entering or pasting barcode numbers manually, typing an apostrophe first will force the application to treat the entry as text.
Manage Barcode Inventory Easily with WPS Spreadsheet
WPS Office provides a powerful, free alternative to Microsoft Excel. With WPS Spreadsheet, you can easily format columns as text to accurately capture barcode data without automatic number conversions, ensuring your inventory tracking remains flawless.
- 1. Open Your Inventory Sheet: Launch WPS Spreadsheet and open your inventory or tracking document.
- 2. Select the Barcode Column: Click the column letter at the top to highlight the entire column intended for barcode inputs.
- 3. Format as Text: Right-click the highlighted area, select 'Format Cells', choose 'Text' under the Category list, and click 'OK'.
- 4. Scan Without Errors: Place your cursor in the top cell and start scanning your barcodes seamlessly without any unwanted data conversions.

Frequently Asked Questions
Why does Excel change my long barcode numbers to numbers with an 'E' in them?
Excel automatically converts numbers with 12 or more digits into scientific notation (e.g., 1.23E+11) to save visual space in the cell. Formatting the target cells as 'Text' before scanning prevents this automatic mathematical conversion.
How do I get my leading zeros back if Excel already removed them?
If the leading zeros were already removed by Excel, simply changing the format to Text won't bring them back. You will need to use the TEXT function (e.g., =TEXT(A1, "0000000000")) to pad the existing numbers to their correct length, or re-scan the items into newly formatted Text cells.
Can I set up my barcode scanner to automatically format the spreadsheet as text?
No, standard barcode scanners act merely as keyboard emulators and only input raw keystrokes. You must configure the spreadsheet software's cell formatting manually prior to scanning.
Does this automatic number conversion issue affect other spreadsheet programs?
Yes, most modern spreadsheet software, including WPS Spreadsheet, automatically detects numbers to facilitate calculations. You will need to apply the same 'Format as Text' solution in any application to preserve literal barcode values.




