Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to convert specific Numbers to Letters...

Hello,

I was wondering if anyone would have an Excel macro that would allow
me to convert any number starting or ending with a ZERO to a letter
such as X,Y,or Z. If not, just a macro that would convert any ZERO to
an X would work fine. I'm tired of having to change my columns to text
every time I move something around or do a TEXT to COLUMN conversion.
I work with many pseudo numbers like: 0012, 0003450, etc. Of course,
since these are not real numbers as such, EXCEL can't accept them.
Thanks for any help or advice you can offer.

SGR
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Macro to convert specific Numbers to Letters...

Try using Replace()

Something like cell.value = replace(cell.value,"0","x")

/i.

"Steven Ratliff" wrote in message
om...
Hello,

I was wondering if anyone would have an Excel macro that would allow
me to convert any number starting or ending with a ZERO to a letter
such as X,Y,or Z. If not, just a macro that would convert any ZERO to
an X would work fine. I'm tired of having to change my columns to text
every time I move something around or do a TEXT to COLUMN conversion.
I work with many pseudo numbers like: 0012, 0003450, etc. Of course,
since these are not real numbers as such, EXCEL can't accept them.
Thanks for any help or advice you can offer.

SGR



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to convert specific Numbers to Letters...

for each cell in selection.SpecialCells(xlConstants,xlTextValues)
cell.Value = Application.Substitute(cell.Text,"0","X")
Next

to reverse

for each cell in selection.SpecialCells(xlConstants,xlTextValues)
cell.Value = "'" & Application.Substitute(cell.Text,"X","0")
Next


--
Regards,
Tom Ogilvy


Steven Ratliff wrote in message
om...
Hello,

I was wondering if anyone would have an Excel macro that would allow
me to convert any number starting or ending with a ZERO to a letter
such as X,Y,or Z. If not, just a macro that would convert any ZERO to
an X would work fine. I'm tired of having to change my columns to text
every time I move something around or do a TEXT to COLUMN conversion.
I work with many pseudo numbers like: 0012, 0003450, etc. Of course,
since these are not real numbers as such, EXCEL can't accept them.
Thanks for any help or advice you can offer.

SGR



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
How do I convert letters to numbers in Excel? scarly123 Excel Discussion (Misc queries) 6 April 3rd 23 01:30 PM
Convert numbers to letters in excel alias Excel Worksheet Functions 2 March 24th 09 03:38 PM
convert letters to numbers g75 Charts and Charting in Excel 9 February 3rd 06 04:33 PM
Convert letters into numbers. i.e. ABCD = 52 Rhapsody 1234 Excel Worksheet Functions 8 December 9th 05 07:33 PM
How to convert numbers to corresponding letters? Ex: 123 to abc jplazola Excel Discussion (Misc queries) 4 June 29th 05 09:29 AM


All times are GMT +1. The time now is 11:04 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"