View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Loop while skipping blanks

try:

For Each cell In Range("C2:C500")
If cell.Value < "" Then cell.Value = CLng(cell.Value)
Next

(Xl2003: blanks give value of 0)

HTH

"jhahes" wrote:


How do I do the following?

I want to convert text to a number but skip the blanks in a range

this is what I have, but it debugs because I have blanks

Range("C2").select
Do
activecell.value = clng(activecell.value)
activecell.offset(1,0).select
Loop Until activecell.row = 500

How do I skip the empty or blank cells but still loop the code to cell
500.

Thank you for any help

Josh


--
jhahes
------------------------------------------------------------------------
jhahes's Profile: http://www.excelforum.com/member.php...o&userid=23596
View this thread: http://www.excelforum.com/showthread...hreadid=524984