Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default add leading character

I have a column of numbers to which I want to add a leading apostrophe. how
do i do it in one go?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default add leading character

Select the cells you want to process and run this:

Sub quote_me()
apos = Chr(39)
For Each r In Selection
r.Value = apos & r.Text
Next
End Sub

--
Gary''s Student - gsnu200763


"Satnam Randhawa" wrote:

I have a column of numbers to which I want to add a leading apostrophe. how
do i do it in one go?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default add leading character

doesnt work...
any other suggestions?

"Gary''s Student" wrote:

Select the cells you want to process and run this:

Sub quote_me()
apos = Chr(39)
For Each r In Selection
r.Value = apos & r.Text
Next
End Sub

--
Gary''s Student - gsnu200763


"Satnam Randhawa" wrote:

I have a column of numbers to which I want to add a leading apostrophe. how
do i do it in one go?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default add leading character

Make sure you run it from the worksheet and select the cells first
--
Gary''s Student - gsnu200763


"Satnam Randhawa" wrote:

doesnt work...
any other suggestions?

"Gary''s Student" wrote:

Select the cells you want to process and run this:

Sub quote_me()
apos = Chr(39)
For Each r In Selection
r.Value = apos & r.Text
Next
End Sub

--
Gary''s Student - gsnu200763


"Satnam Randhawa" wrote:

I have a column of numbers to which I want to add a leading apostrophe. how
do i do it in one go?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default add leading character

I have selected the cells but its showing an error in the code when i try to
write it in the macro..

"Gary''s Student" wrote:

Make sure you run it from the worksheet and select the cells first
--
Gary''s Student - gsnu200763


"Satnam Randhawa" wrote:

doesnt work...
any other suggestions?

"Gary''s Student" wrote:

Select the cells you want to process and run this:

Sub quote_me()
apos = Chr(39)
For Each r In Selection
r.Value = apos & r.Text
Next
End Sub

--
Gary''s Student - gsnu200763


"Satnam Randhawa" wrote:

I have a column of numbers to which I want to add a leading apostrophe. how
do i do it in one go?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default add leading character

Maybe you need to declare the variables.

Sub quote_me()
Dim apos As Variant
Dim r As Variant
apos = Chr(39)
For Each r In Selection
r.Value = apos & r.Text
Next
End Sub

HTH
Regards,
Howard

"Satnam Randhawa" wrote in
message ...
I have a column of numbers to which I want to add a leading apostrophe. how
do i do it in one go?



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default add leading character

Hello there.

Why not use something simple like:
In a cell next to the top piece of data type a space and apostrophe.
Then in an empty cell on the same line use =right(a1,1) & a2
where A1 is the cell with the apostrophe and a2 is the cell with your number .
Once done rip it down as far as you want.
If needed highlight new column of data and copy- Paste special values over
the top of your formulas to hard case them in.

Dave

"Satnam Randhawa" wrote:

I have a column of numbers to which I want to add a leading apostrophe. how
do i do it in one go?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to add character before leading zero in a field Melin Excel Discussion (Misc queries) 7 December 8th 07 05:21 AM
Excel-Match 1st text character in a string to a known character? bushlite Excel Worksheet Functions 2 January 15th 07 06:36 PM
Can I create a special character for the Character Map? JohnP Excel Discussion (Misc queries) 3 December 24th 06 01:10 AM
How do I force a leading zero character eg 07817 m800afc Excel Discussion (Misc queries) 3 March 22nd 06 07:27 PM
Leading zero Firefli Excel Discussion (Misc queries) 2 November 9th 05 05:27 PM


All times are GMT +1. The time now is 05:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"