ateneva
4/16/2017 - 3:09 PM

Ask user which formulas he/she would like to replace with values

Ask user which formulas he/she would like to replace with values

Sub ZapFormulaValuesUserInput()
Dim MyRange As Range
Dim Cell As Range
Dim prv As Variant
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'written by Angelina Teneva, September 2016
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With ActiveSheet

On Error GoTo handler
Set MyRange = Application.InputBox(Prompt:="Please Select a Range", _
Title:="Choose Range to convert to values", Type:=8)

For Each Cell In MyRange.SpecialCells(xlCellTypeVisible)
    If Not IsEmpty(Cell) = True Then
    
        prv = Cell.Value
        If Cell.HasFormula = True Then Cell.Value = prv
    End If

Next Cell

handler: MsgBox ("Operation Cancelled or Completed")
End With
End Sub