Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how do i get word conversion number to text in excel (100 = "hundr

how do i get word conversion number to text in excel (100 = "hundred")
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default how do i get word conversion number to text in excel (100 = "hundr

See http://www.xldynamic.com/source/xld.xlFAQ0004.html

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"ismayil" wrote in message
...
how do i get word conversion number to text in excel (100 = "hundred")



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how do i get word conversion number to text in excel (100 = "hundr



"ismayil" wrote:

how do i get word conversion number to text in excel (100 = "hundred")

Private Function GetColumnName(ByVal colNumber As Integer) As String
Dim colName As String = String.Empty
Dim quotient As Integer = 0
Dim remainder As Integer = 0

If colNumber <= 26 Then
colName = Convert.ToChar(colNumber + 64)
Return colName
Else
Dim fChar As String = String.Empty
Dim sChar As String = String.Empty

quotient = colNumber \ 26
remainder = colNumber Mod 26
If remainder = 0 Then
fChar = Me.GetColumnName(quotient - 1)
Else
fChar = Me.GetColumnName(quotient)
End If


If remainder = 0 Then
sChar = "Z"
Else
sChar = Me.GetColumnName(remainder)
End If


colName = String.Concat(fChar, sChar)

Return colName
End If

End Function
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default how do i get word conversion number to text in excel (100 = "hundr

Private Function GetColumnName(ByVal colNumber As Integer) As String

That can be greatly simplified to:

Function ColLetter(ColNum As Long) As String
ColLetter = Split(Worksheets(1).Cells(1, ColNum).Address(True, False),
"$")(0)
End Function


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)



"YourHelp" wrote in message
...


"ismayil" wrote:

how do i get word conversion number to text in excel (100 = "hundred")

Private Function GetColumnName(ByVal colNumber As Integer) As String
Dim colName As String = String.Empty
Dim quotient As Integer = 0
Dim remainder As Integer = 0

If colNumber <= 26 Then
colName = Convert.ToChar(colNumber + 64)
Return colName
Else
Dim fChar As String = String.Empty
Dim sChar As String = String.Empty

quotient = colNumber \ 26
remainder = colNumber Mod 26
If remainder = 0 Then
fChar = Me.GetColumnName(quotient - 1)
Else
fChar = Me.GetColumnName(quotient)
End If


If remainder = 0 Then
sChar = "Z"
Else
sChar = Me.GetColumnName(remainder)
End If


colName = String.Concat(fChar, sChar)

Return colName
End If

End Function


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
Number conversion to text in Ms excel bafarooqi Excel Worksheet Functions 2 November 20th 08 08:40 AM
how i convert "100" to "hundred"( number to text) in excel-2007 mohanraj Excel Worksheet Functions 1 May 11th 08 09:07 PM
macro for converting number stored as "text" (or preceeded with ') to "number" formatting markx Excel Programming 1 June 30th 06 12:14 PM
macro for converting number stored as "text" (or preceeded with ') to "number" formatting markx Excel Programming 1 June 23rd 06 03:15 PM
Excel conversion to word 2000 Text Eric Excel Programming 2 November 28th 04 04:23 PM


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