Replacing formula with value

Bakerson

New Member
Joined
May 30, 2008
Messages
4
Help me please!!
I have a set of data which I need to partially paste values only. However, I don't want to replace all values. The vertical list of data includes sumif functions, sum functions, if functions and simple additions, divisions and multplications as well as blank cells.
What i want to achieve is a macro that will only replace the sumifs with values.
does anyone know how to do this?
cheers
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Maybe try:

Code:
Sub ConvertSUMIFToValues()
    Dim WorkRange As Range
    Dim Cell As Range
    On Error Resume Next
    Set WorkRange = Selection.SpecialCells(xlCellTypeFormulas)
    If Err <> 0 Then Exit Sub
    For Each Cell In WorkRange
        If Left(Cell.Formula, 6) = "=SUMIF" Then
            Cell.Value = Cell.Value
        End If
    Next Cell
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,975
Members
449,200
Latest member
Jamil ahmed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top