Home |
Search |
Today's Posts |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Eliminate ALL cells containing the same data | Excel Discussion (Misc queries) | |||
Modify to eliminate #NUM! error | Excel Worksheet Functions | |||
Eliminate zero value cells in an EXCEL chart | Charts and Charting in Excel | |||
Eliminate matching cells | Excel Discussion (Misc queries) | |||
How do I eliminate, in Excel XP, "too many cell formats" error? | Excel Discussion (Misc queries) |