PC Review


Reply
Thread Tools Rate Thread

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

 
 
ismayil
Guest
Posts: n/a
 
      27th Dec 2007
how do i get word conversion number to text in excel (100 = "hundred")
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      27th Dec 2007
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" <(E-Mail Removed)> wrote in message
news:E003D5F4-D35B-4A3A-81DE-(E-Mail Removed)...
> how do i get word conversion number to text in excel (100 = "hundred")



 
Reply With Quote
 
YourHelp
Guest
Posts: n/a
 
      27th Dec 2007


"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 With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      27th Dec 2007
> 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" <(E-Mail Removed)> wrote in message
news:3870423E-4E98-4EF0-AD75-(E-Mail Removed)...
>
>
> "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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto conversion of the Text to Number Getting Failed in Excel 2007 Yuvaraj Mani Microsoft Excel Programming 2 9th Oct 2009 12:56 PM
why "Type Conversion Failure" import EXCEL into ACESS TEXT field Joe Microsoft Access External Data 1 25th Aug 2009 05:34 PM
Re: Number conversion to text in Ms excel Bob Phillips Microsoft Excel Worksheet Functions 0 20th Nov 2008 08:40 AM
Re: Number conversion to text in Ms excel muddan madhu Microsoft Excel Worksheet Functions 0 20th Nov 2008 07:09 AM
Excel conversion to word 2000 Text =?Utf-8?B?RXJpYw==?= Microsoft Excel Programming 2 28th Nov 2004 04:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:53 PM.