View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Duke Carey Duke Carey is offline
external usenet poster
 
Posts: 1,081
Default Loop while skipping blanks

dim x as int

x=0
with Range("C2")
Do
if len( .offset(x,0))0 then .offset(x,0).value = clng(.offset(x,0))
x=x+1
Loop Until x=499

end with



"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