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

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

Bernie Deitrick

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
 
J

JoeU2004

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top