LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default To be got Alphabetic

Moideen wrote:

I Tried with the below mentioned VBA code "0" not showing.

Eg : 1.550 , Shown only : A.FF, To be Shown : A.FFS

Private Sub Worksheet_Change(ByVal Target As Range)
For Each cell In Target
If cell.Column = 1 Then cell.Offset(0, 1).Value = Replace(Replace( _
Replace(Replace(Replace(cell.Value, 1, "A"), 2, "B"), 3, "C"), _
4, "D"), 5, "F"), 0, "S")
Next
End Sub


As I said before, you can extend the function by adding more levels of
SUBSTITUTE or Replace as necessary -- meaning you need to *actually add
another copy of the keyword*, not just the info to be replaced:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBST ITUTE(SUBSTITUTE
(A1,1,"A"),2,"B"),3,"C"),4,"D"),5,"F"),0,"S")

If cell.Column = 1 Then cell.Offset(0, 1).Value = Replace(Replace( _
Replace(Replace(Replace(Replace(cell.Value, 1, "A"), 2, "B"), _
3, "C"), 4, "D"), 5, "F"), 0, "S")

If you need a seventh replacement, you need a seventh SUBSTITUTE/Replace...
but this is going to get unwieldy pretty fast, especially if you're replacing
*every* digit with a letter.

If you have more than this, you should go back to looking the digits up in an
array, similar (but not identical) to my first reply.

--
Here is an idea for you geniuses:
Point your weapons at the bugs and shoot.
If they die, the guns work. If not, grab a brick.
 
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
Auto alphabetic [email protected] Excel Worksheet Functions 1 November 27th 07 04:30 PM
HIghest Value - Numeric and Alphabetic De-coi via OfficeKB.com Excel Worksheet Functions 2 December 7th 06 12:01 PM
how can I set up an alphabetic sequence? JackLWinans Excel Discussion (Misc queries) 2 May 1st 06 06:25 PM
Alphabetic autofill dogisnuts Excel Discussion (Misc queries) 3 June 17th 05 03:16 AM
alphabetic order adm1 Excel Programming 0 December 18th 03 09:26 PM


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