View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
L. Howard L. Howard is offline
external usenet poster
 
Posts: 852
Default VLOOKUP formulas only set to values

The need is to change the existing worksheet vlookup returns to a value.
(And/or many worksheets)

The Vlookup formulas are the only targets I want to change to values.
A specific range on the sheet is okay instead of UsedRange.

This does set Vlookup formulas to values, but it also sets all other formulas to values.

Thanks.
Howard


Sub VLOOKUP_to_VALUE()

Dim FindV As String
Dim RngD As Range
Dim ws As Worksheet
Dim LRow As Long

FindV = "VLOOKUP"

For Each ws In ThisWorkbook.Worksheets

With ws.UsedRange

Set RngD = .Find((FindV), , xlFormulas, xlPart)

If Not RngD Is Nothing Then
.Value = .Value
End If

End With

Next ws

End Sub