ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   need help in adding a ' in front of a column of numbers (https://www.excelbanter.com/new-users-excel/202471-need-help-adding-front-column-numbers.html)

noreaster

need help in adding a ' in front of a column of numbers
 
From what I read, a macro does not recored keystrokes. I'm new at this so
bear with me. I have found out that I can make numbers read as text by
adding a ' in front of the number Exa, '3331 '3331-6 '3331-25 so after doing
a sort as text the numbers will be in proper order. I have a column of part
numbers that I need to add a ' in front of the number so it will sort the way
I want. I am using excel 2003.

TIA

Niek Otten

need help in adding a ' in front of a column of numbers
 
Another way to make it text is with a formula:

=TEXT(A1,"@")

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"noreaster" wrote in message ...
| From what I read, a macro does not recored keystrokes. I'm new at this so
| bear with me. I have found out that I can make numbers read as text by
| adding a ' in front of the number Exa, '3331 '3331-6 '3331-25 so after doing
| a sort as text the numbers will be in proper order. I have a column of part
| numbers that I need to add a ' in front of the number so it will sort the way
| I want. I am using excel 2003.
|
| TIA



Gary''s Student

need help in adding a ' in front of a column of numbers
 
Select the cells you want to change and run this macro:

Sub dontquoteme()
Dim s As String
Dim cell As Range
s = Chr(39)
For Each cell In Selection
cell.Value = s & cell.Value
Next
End Sub
--
Gary''s Student - gsnu200804


"noreaster" wrote:

From what I read, a macro does not recored keystrokes. I'm new at this so
bear with me. I have found out that I can make numbers read as text by
adding a ' in front of the number Exa, '3331 '3331-6 '3331-25 so after doing
a sort as text the numbers will be in proper order. I have a column of part
numbers that I need to add a ' in front of the number so it will sort the way
I want. I am using excel 2003.

TIA


noreaster

need help in adding a ' in front of a column of numbers
 
That worked out great, Thank you so much. Most of the code I understand. What
sites do you recommend for learning for newbies and definitions?


"Gary''s Student" wrote:

Select the cells you want to change and run this macro:

Sub dontquoteme()
Dim s As String
Dim cell As Range
s = Chr(39)
For Each cell In Selection
cell.Value = s & cell.Value
Next
End Sub
--
Gary''s Student - gsnu200804


"noreaster" wrote:

From what I read, a macro does not recored keystrokes. I'm new at this so
bear with me. I have found out that I can make numbers read as text by
adding a ' in front of the number Exa, '3331 '3331-6 '3331-25 so after doing
a sort as text the numbers will be in proper order. I have a column of part
numbers that I need to add a ' in front of the number so it will sort the way
I want. I am using excel 2003.

TIA


Gary''s Student

need help in adding a ' in front of a column of numbers
 
Start with:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
Gary''s Student - gsnu200804


"noreaster" wrote:

That worked out great, Thank you so much. Most of the code I understand. What
sites do you recommend for learning for newbies and definitions?


"Gary''s Student" wrote:

Select the cells you want to change and run this macro:

Sub dontquoteme()
Dim s As String
Dim cell As Range
s = Chr(39)
For Each cell In Selection
cell.Value = s & cell.Value
Next
End Sub
--
Gary''s Student - gsnu200804


"noreaster" wrote:

From what I read, a macro does not recored keystrokes. I'm new at this so
bear with me. I have found out that I can make numbers read as text by
adding a ' in front of the number Exa, '3331 '3331-6 '3331-25 so after doing
a sort as text the numbers will be in proper order. I have a column of part
numbers that I need to add a ' in front of the number so it will sort the way
I want. I am using excel 2003.

TIA



All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com