VBA & Macro Problems

Use VBA in WPS Spreadsheets to Convert Scientific-Notation Job Numbers to Text

Kushani NimanthikaKushani Nimanthika Nov 13, 2026 869 views

Question details

The user needs a VBA macro that converts exported scientific-notation job numbers into a consistent text format such as 12345E-01.

Use VBA in WPS Spreadsheets to Convert Scientific-Notation Job Numbers to Text
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA editor

In WPS Spreadsheets, press Alt+F11 to open the VBA editor.

2
Insert a new module

Click Insert > Module in the VBA editor menu bar to create a module for the macro.

3
Paste and save the VBA code

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

4
Run the macro

Select the job number cells in the worksheet, press Alt+F8, choose ConvertScientificJobNumbers, and click Run.

5
Verify the text format

Click any converted cell and check the formula bar. The value should appear as text with a leading apostrophe, such as '12345E-01.

Use a VBA Macro to Convert Scientific-Notation Job Numbers to Text in WPS Spreadsheets
Job numbers are now text: The leading apostrophe keeps the value as text, so WPS Spreadsheets will not reinterpret it as a number.
Direct VBA solution

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. 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. 2. Open the VBA editor: Press Alt+F11 and insert a new module from Insert > Module.
  3. 3. Add and save the macro: Paste the conversion VBA code, then click File > Save to store it in the workbook.
  4. 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.
Runs Excel-compatible VBA macros directly in WPS SpreadsheetsPrevents exported job numbers from changing back to scientific notationLightweight and free Office suite with a familiar ribbon and VBA editorMaintains .xlsm and .xlsx compatibility with Microsoft Excel
microsoft office alternative - wps office

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.