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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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