View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default convert text to number - performance problem

Hi Vladimir, can you paste the full code (or atleast the code above For
Each). Also usually range is specified as below

Dim MyRange As Range
Set MyRange = Range("A1:A10")
For Each c In MyRange.Cells
c.Value = CSng(c.Value)
Next c

If this post helps click Yes
---------------
Jacob Skaria


"Vladimir Sveda" wrote:

In my VBA code I use:
...
For Each c In Range("MyRange").Cells
c.Value = CSng(c.Value)
Next c
...
and it is performance bootleneck of that code

Can you, please, suggest better code.
Thank you in advance!

Vlado