Use VBA in WPS Spreadsheets to Convert Scientific-Notation Job Numbers to Text
Question details
The user needs a VBA macro that converts exported scientific-notation job numbers into a consistent text format such as 12345E-01.

- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- The user is working with exported job numbers in a spreadsheet and needs to normalize scientific-notation values into a consistent text format for reporting or further processing.
- Observed behavior
- When the job numbers are exported or opened, they appear in scientific notation instead of the required fixed text format.
Open the workbook that contains the exported job numbers and identify the column or range to convert. In WPS Spreadsheets, enable macros and open the VBA editor before running the conversion.
Use a VBA Macro to Convert Scientific-Notation Job Numbers to Text in WPS Spreadsheets
Use this method when you need a repeatable macro that converts a selected range of exported job numbers into consistent text values ending in E-01.
This macro loops through the selected cells, reads the value, removes the decimal point, appends E-01, and stores the result as text with a leading apostrophe. The leading apostrophe prevents WPS Spreadsheets from re-applying scientific notation or numeric formatting.
In WPS Spreadsheets, press Alt+F11 to open the VBA editor.
Click Insert > Module in the VBA editor menu bar to create a module for the macro.
Paste the following macro, then click File > Save: Sub ConvertScientificJobNumbers() Dim cell As Range For Each cell In Selection If Trim(CStr(cell.Value)) <> "" Then cell.Value = "'" & Replace(Trim(CStr(cell.Value)), ".", "") & "E-01" End If Next cell End Sub
Select the job number cells in the worksheet, press Alt+F8, choose ConvertScientificJobNumbers, and click Run.
Click any converted cell and check the formula bar. The value should appear as text with a leading apostrophe, such as '12345E-01.

Adjust the VBA Transformation for a Different Source Format or Exponent
Use this method when the exported source format is different and you need to change the decimal removal or exponent logic.
Convert Scientific Notation Job Numbers to Text with WPS Spreadsheets VBA
WPS Spreadsheets supports Excel-compatible VBA macros, so you can run the same conversion routine to normalize exported job numbers into fixed text values without switching tools.
- 1. Open the workbook in WPS Spreadsheets: Install WPS Office, launch WPS Spreadsheets, and open the workbook containing the exported scientific-notation job numbers.
- 2. Open the VBA editor: Press Alt+F11 and insert a new module from Insert > Module.
- 3. Add and save the macro: Paste the conversion VBA code, then click File > Save to store it in the workbook.
- 4. Run the macro and verify: Select the target cells, press Alt+F8, run the macro, and confirm the values are stored as text such as 12345E-01.

Frequently Asked Questions
Why does WPS Spreadsheets show long job numbers in scientific notation?
WPS Spreadsheets applies scientific notation when a number is too long for the current column width or exceeds normal numeric display limits. You can format the column as Text before entering values, or use a VBA macro to convert existing cells to text.
Can I convert scientific notation to text without VBA?
Yes, you can format the target cells as Text and re-enter the values, or use a formula such as =TEXT(A1,"0.00E+00") to create a text representation. However, VBA is more reliable when you need to process many existing cells and keep a leading apostrophe.
Does this VBA macro work in WPS Spreadsheets if it was written for Microsoft Excel?
WPS Spreadsheets supports many Excel-compatible VBA macros. Open the workbook in WPS Spreadsheets, enable macros, and test the macro in a copy if it uses features outside the supported object model.
Why does the macro add a leading apostrophe before the job number?
The leading apostrophe forces the cell value to be treated as text. Without it, WPS Spreadsheets may convert the result back into a number or reapply scientific notation.
How do I stop exported job numbers from becoming scientific notation in the future?
Format the destination column as Text before importing or pasting the data. In WPS Spreadsheets, select the column, right-click, choose Format Cells, and set the Number tab to Text.




