LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default catching "#DIV/0!" in a loop

Thank you Bernie,

This helps greatly...

sck10


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Forget the loop, just use

Range("rng_test").Replace Chr(10), " "
Range("rng_test").Replace Chr(13), " "

HTH,
Bernie
MS Excel MVP


"sck10" wrote in message
...
Hello,

I am running the following to replace "alt+Enter". Whenever I run across
a cell with the value of "#DIV/0!" I get an error (Error = 2007). What
I don't understand is that the "#DIV/0!" is not a equation, but a value.
Any help with this would be appreciated.

Thanks, sck10


Range("rng_test").Select
Dim myCell As Range
'For Each myCell In Range("rng_template").Cells
For Each myCell In Selection.Cells
Range("rng_value").Value = myCell.Value

End If
If myCell.Value = "#DIV/0!" Then
myCell.Value = ""
End If

myCell.Value = Replace(myCell.Value, Chr(10), " ")
myCell.Value = Replace(myCell.Value, Chr(13), " ")
Next





 
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Question on determining "ROW" inside of a "For .. RANGE " loop David Schrader[_2_] Excel Programming 2 January 3rd 07 08:18 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Catching "no cells were found" jose luis Excel Programming 3 June 30th 05 08:56 PM
LOOP BETWEEN "FRONT" AND "END" SHEETS? ewan7279 Excel Programming 7 March 17th 05 03:11 PM


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