LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default conversion

Private Sub CommandButton1_Click()

Dim Cell As Range

For Each Cell In ActiveSheet.Range("G:G")
Cell = nConvert(Cell.Value)
Next Cell

End Sub

Function nConvert(str As String) As String

If str < "" Then nConvert = Left(str, Len(str) - Len(Right(str, 2))) & "."
& Right(str, 2)

End Function


"Hemant_india" wrote:

hi
i have written follwing code

Private Sub CommandButton1_Click()
Dim rng As Range
Set rng = ActiveSheet.Range("g:g")
For Each col In rng
col.Value = nconvert(col.Text)
Next col

'TextBox1.Text = nconvert("3500000")

End Sub
====
Function nconvert(tsh) As String
If tsh < 0 Then ' Evaluate argument.
Exit Function ' Exit to calling procedure.
Else
leftside = Left(tsh, Len(tsh) - Len(Right(tsh, 2)))
nconvert = CStr(leftside) & "." & CStr(Right(tsh, 2))

End If
End Function
my problem is if this code is run again and again
amount will go on reducing
please suggest otherwise
--
hemu

 
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
Help on conversion Help on formula[_2_] Excel Discussion (Misc queries) 3 September 11th 09 07:13 AM
conversion Bailey Excel Discussion (Misc queries) 1 August 12th 09 11:13 PM
dec 2 bin conversion sai Excel Worksheet Functions 2 October 29th 08 07:21 PM
E12 conversion Valex Excel Programming 1 August 5th 04 09:20 AM
XLS to CSV conversion border21 Excel Programming 2 June 10th 04 02:38 AM


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