M
Minitman
Greetings,
I found a solution to my copy and paste problem in the archives.
the problem is that I need to paste an empty cell as a choice in my IF
statement. Here is the formula in the cell called pfCell_1:
=IF(OFFSET(clStart,pfDisc,1)=0,"",OFFSET(clStart,pfDisc,1))
After I run the macro to overwrite the contents of the 79 named
ranges, this is what is returned in pfCell_1:
=IF(OFFSET(clStart,pfDisc,1)=0,,OFFSET(clStart,pfDisc,1))
Notice the missing "" marks.
Here is the macro that changes all 79 named ranges at one time:
Sub RecoverFormulas()
Dim i As Integer
With ActiveSheet
For i = 1 To 79
If Not i = 26 Then .Range("pfCell_" & i).Formula = _
"=IF(OFFSET(clStart,pfDisc," & i & _
")=0,,OFFSET(clStart,pfDisc," & i & "))"
Next i
End With
End Sub
When I tried to put "" between the ,,'s, debug kicked in and stopped
the macro with an error message - it did not like the ""'s !!!
How can This be rewritten so the I get empty named range if the result
is 0???
Any ideas, suggestions or thought on this matter?
Any help is appreciated.
-Minitman
I found a solution to my copy and paste problem in the archives.
the problem is that I need to paste an empty cell as a choice in my IF
statement. Here is the formula in the cell called pfCell_1:
=IF(OFFSET(clStart,pfDisc,1)=0,"",OFFSET(clStart,pfDisc,1))
After I run the macro to overwrite the contents of the 79 named
ranges, this is what is returned in pfCell_1:
=IF(OFFSET(clStart,pfDisc,1)=0,,OFFSET(clStart,pfDisc,1))
Notice the missing "" marks.
Here is the macro that changes all 79 named ranges at one time:
Sub RecoverFormulas()
Dim i As Integer
With ActiveSheet
For i = 1 To 79
If Not i = 26 Then .Range("pfCell_" & i).Formula = _
"=IF(OFFSET(clStart,pfDisc," & i & _
")=0,,OFFSET(clStart,pfDisc," & i & "))"
Next i
End With
End Sub
When I tried to put "" between the ,,'s, debug kicked in and stopped
the macro with an error message - it did not like the ""'s !!!
How can This be rewritten so the I get empty named range if the result
is 0???
Any ideas, suggestions or thought on this matter?
Any help is appreciated.
-Minitman