View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Hemant_india[_2_] Hemant_india[_2_] is offline
external usenet poster
 
Posts: 107
Default usedRange problem

sorry nick
cells in question contains amount imported from a sequential file
e.g 1234500----actual amt is 12345.00
actually i want to limit loop for usedRange only
--
hemu


"NickHK" wrote:

Is that a question or a solution ?
You should Dim "col" so we know what it is.
What if col.text="" ?

NickHK

"Hemant_india" wrote in message
...
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
======
Dim rng As Range
Set rng = ActiveSheet.UsedRange.Range("f:f")
For Each col In rng
col.Select
col.Value = nconvert(col.Text)
Next col

--
hemu


"NickHK" wrote:

I'm not sure, but is this what you want ?
Dim rng As Range
Set rng = Intersect(ActiveSheet.UsedRange, ActiveSheet.Range("E:E"))
rng.FormulaR1C1 = "Some New Text"

NickHK

P.S It would be better if you pasted your actual code rather than type

out
what you think you have.


"Hemant_india" wrote in message
...
hi
i have following code
dim rng as range
dim rng1 as range
set rng=activesheet.usedrange
set rng1=rng.range("E:E")
for each col in rng1
col.text=somethiing
next
the problem is loop go through every cell in the range

help please
--
hemu