Display a Leading Apostrophe as Text in an Excel Cell
Question details
Make a leading apostrophe visible as cell content and preserve it for export to SQL.

- 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.
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.
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.
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.
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.
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.
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.

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. Open the workbook: Open WPS Spreadsheets and choose File > Open to select your Excel workbook.
- 2. Add the apostrophe: In an empty cell, enter =CHAR(39)&A2, replacing A2 with the source cell, and press Enter.
- 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. 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.

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.




