Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to add character before leading zero in a field | Excel Discussion (Misc queries) | |||
Excel-Match 1st text character in a string to a known character? | Excel Worksheet Functions | |||
Can I create a special character for the Character Map? | Excel Discussion (Misc queries) | |||
How do I force a leading zero character eg 07817 | Excel Discussion (Misc queries) | |||
Leading zero | Excel Discussion (Misc queries) |