View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default Another Question Concerning Replacing Formulae With Values !

I responded to the current question--not the original.

But doesn't your solution require xl2002+ to use .breaklink?


keepITcool wrote:

I'm the only one that gave the "correct" reply.
but no reaction from OP.

the original question included:

I have a lot of cells with formulae in a lot of cells with links in.
It's the links I really need to remove, the internal formalue can stay
if need be.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

Dave Peterson wrote :

Depending on how the formulas are spreadout this might be a little
quicker:

Option Explicit

Sub testme()

Dim myRng As Range
Dim myArea As Range

Set myRng = Nothing
On Error Resume Next
Set myRng = ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas)
On Error GoTo 0

If myRng Is Nothing Then
'no formulas
Else
For Each myArea In myRng.Areas
With myArea
.Value = .Value
End With
Next myArea
End If

End Sub

I used the Activesheet and converted all the cells--but you could
limit the range.

But if you want all the formulas converted to values:

with activesheet.usedrange
.value = .value
end with


wrote:

extension to last post. I pressed Post too early!

but this doesn't work...
Cells.SpecialCells(xlCellTypeFormulas).Select
With Selection
.Value = .Value
End With
.... Can anybody tell my why.


--

Dave Peterson