Data Import & Export

Display a Leading Apostrophe as Text in an Excel Cell

Camila MilosovichCamila Milosovich Nov 22, 2026 868 views

Question details

Make a leading apostrophe visible as cell content and preserve it for export to SQL.

Display a Leading Apostrophe as Text in an Excel Cell
Product
Microsoft Excel
Device & OS
not provided
Scenario
Data populated in Excel with VBA needs a leading apostrophe to be part of the exported value.
Observed behavior
A leading apostrophe used as Excel's text prefix may appear in the formula bar but not in the worksheet cell or CSV output.
Before you start

Identify the cells where the apostrophe is a hidden text prefix rather than a visible character. Choose an empty column for the corrected values, and check that the source text is already in the desired format.

Solution 1Recommended

Add a Visible Apostrophe with the CHAR Function in Excel

Use a helper column to create values containing an actual apostrophe instead of relying on Excel's hidden text prefix.

CHAR(39) returns an apostrophe as part of the formula result. Apply the formula only to rows that need an apostrophe; otherwise, you may add an extra one.

1
Create the corrected value

If the source value is in A2, enter =CHAR(39)&A2 in an empty cell such as B2 and press Enter. The apostrophe should appear in B2.

2
Fill the helper column

Select B2 and drag its fill handle down to apply the formula to the other relevant rows. Check the results for unwanted or duplicate apostrophes.

3
Export the results

Use the helper-column values in your SQL import process. For a CSV export, choose File > Save As and select a CSV format, then open the resulting file in a text editor to verify the apostrophes.

4
Use the values in VBA if needed

In VBA, read the calculated helper cell with a reference such as Range("B2").Value2 and pass the resulting string to SQL using a parameterized query.

Add a Visible Apostrophe with the CHAR Function in Excel
Check the destination: A visible apostrophe is part of the resulting data. Verify that the CSV or SQL destination expects it, and do not treat it as SQL syntax.
Work with text in WPS Spreadsheets

Preserve a Leading Apostrophe in WPS Spreadsheets

Use a CHAR formula in WPS Spreadsheets to create a visible leading apostrophe, then export the resulting values for your data workflow.

  1. 1. Open the workbook: Open WPS Spreadsheets and choose File > Open to select your Excel workbook.
  2. 2. Add the apostrophe: In an empty cell, enter =CHAR(39)&A2, replacing A2 with the source cell, and press Enter.
  3. 3. Fill and check the results: Drag the formula cell's fill handle down for the rows that need it, and check that each result has the intended apostrophe.
  4. 4. Export and verify: Choose File > Save As and select CSV if your import process requires it. Open the CSV in a text editor to verify the apostrophes before importing it.
Create a visible leading apostrophe with CHAR(39)Open and edit Microsoft Excel XLSX filesExport spreadsheet values to CSVUse a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel hide the apostrophe at the beginning of a cell?

Excel can use a leading apostrophe as a text prefix rather than as part of the cell value. It may appear in the formula bar but not in the worksheet or CSV output.

How can I add an actual apostrophe to a cell value?

In an empty cell, enter =CHAR(39)&A2, replacing A2 with the source cell. The formula returns an apostrophe followed by the source value.

Will typing two apostrophes preserve one in a CSV file?

Two leading apostrophes can display as one in Excel, but the exported result depends on how the value was entered and processed. Save a test CSV and inspect it in a text editor before relying on this method.

How should VBA send the apostrophe to SQL?

Read the corrected cell value with Range("B2").Value2 and pass it as a parameter in your SQL command. Parameterization keeps the apostrophe in the data from being interpreted as SQL syntax.