LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
kayabob
 
Posts: n/a
Default Insert text in a cell with a macro

I have a series of numbers (SSN) that I need to turn into text, so I want a
macro that will put an apostrophe and a zero at the beginning of the numbers.
I know that there are other ways to change a number to text (formatting,
find/replace to add the apostrophe) but for what we are doing, manually
editing to add the apostrophe and zero is the only thing that works. SO.. to
my question. When I make the macro to do this, of course it simply adds the
apostrophe and zero and repeats the number from the first cell over and over
again. How can I make it select each cell's new data, move to the beginning
of the number and add the apostrophe? Here is my macro that is obviously not
working.

ActiveCell.FormulaR1C1 = "'012365564"
ActiveCell.Offset(1, 0).Range("A1").Select

I see that the problem is that it is picking up the literal from the first
line, but how can I make the macro edit the new numbers in each line and not
repeat this text over and over.
 
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
Relative Cell position NOT working with or without macro Scratching my Head Excel Discussion (Misc queries) 6 May 30th 05 06:12 PM
Text wider than one cell is not displayed in the next empty cell Len Pace Excel Discussion (Misc queries) 5 February 18th 05 12:24 AM
Insert value of a cell as a filename Ralph Howarth Excel Worksheet Functions 0 January 18th 05 12:03 AM
Macro or Function to make text size to suite text Length? lbbss Excel Discussion (Misc queries) 4 December 14th 04 07:53 PM
Formatting a cell as "text" in the number catagory. Ed Excel Worksheet Functions 3 December 7th 04 07:12 PM


All times are GMT +1. The time now is 06:00 AM.

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

About Us

"It's about Microsoft Excel"