How do I add an apostrophy to a range of existing cells?

  • Thread starter Thread starter stuck
  • Start date Start date
S

stuck

I need to be able to add an apostrophy in front of numbers in a range of
existing cells without having to type it into each cell. I am trying to set
up a spreadsheet that I can import into accpac and I need to have the
apostrophy there.
 
Select the cells, and run this macro:

Sub MakeText()
Dim myCell As Range

With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.EnableEvents = False
End With

For Each myCell In Selection
myCell.Value = "'" & myCell.Value
Next myCell

With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
.EnableEvents = True
End With
End Sub



OR, use a set of formulas:

="'" & A1

then copy to match your set of numbers, then copy and paste special values.


HTH,
Bernie
MS Excel MVP
 
stuck said:
I need to be able to add an apostrophy in front of numbers in a range of
existing cells without having to type it into each cell. I am trying to
set
up a spreadsheet that I can import into accpac and I need to have the
apostrophy there.

I wonder if the apostrophe prefix is sufficient, much less necessary.

How do you save the worksheet so that it can be imported into ACCPAC?

If you save the worksheet as a ".csv" file, note that apostrophe prefixes
are not recorded in the CSV file. The CSV file makes no distinction between
cells with numbers and cells with numeric text, even if you format the cell
as Text.

However, numeric text within double-quotes (literally "123") is recorded in
the CSV file in a distinctive manner.
 
Back
Top