LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.programming
GF6 GF6 is offline
external usenet poster
 
Posts: 2
Default DIV/0 ERROR - How eliminate them in many cells contemporaneously

On the line which begins temparray(i,j)= the copy paste inserted a line
break. Either go to the end of the line and hit the delete key until it
is all one line or after the last ampersand hit space and underscore (
_) to create a line continuation.

Metallo wrote:
Hi JWolf,

When I run the macro, the following error pops up:

Compile error:
expected: Line number, or label or statement or end of statement

This is what I paste:


Option Base 1
Sub repldivzero()
Application.ScreenUpdating = False
Dim rowcount As Long
Dim colcount As Integer
Dim i As Long
Dim j As Integer
Dim trange As Range
Dim temparray
Dim cell As Range
Dim div0formula As String
rowcount = ActiveSheet.UsedRange.Rows.Count
colcount = ActiveSheet.UsedRange.Columns.Count
ReDim temparray(rowcount, colcount)
For i = 1 To rowcount
For j = 1 To colcount
Set cell = Cells(i, j)
temparray(i, j) = cell.Formula
If IsError(cell.Value) Then
If cell.Value = CVErr(xlErrDiv0) Then
div0formula = Mid(cell.Formula, 2)
temparray(i, j) = "=IF(ISERROR(" & div0formula &
"),""""," & div0formula & ")"
End If
End If
Next j
Next i
ActiveSheet.UsedRange.Formula = temparray
Application.ScreenUpdating = True
End Sub



I'm sure you see where the issue is.

Thanks again for your help

Metallo



 
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
Eliminate ALL cells containing the same data Herbert Seidenberg Excel Discussion (Misc queries) 1 March 13th 10 10:23 PM
Modify to eliminate #NUM! error Gotroots Excel Worksheet Functions 6 December 9th 09 05:16 PM
Eliminate zero value cells in an EXCEL chart Mário Lopes Charts and Charting in Excel 1 December 26th 06 07:19 PM
Eliminate matching cells GARY Excel Discussion (Misc queries) 0 August 22nd 06 05:07 PM
How do I eliminate, in Excel XP, "too many cell formats" error? Dennis Excel Discussion (Misc queries) 2 March 24th 05 06:44 PM


All times are GMT +1. The time now is 10:18 PM.

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"