Macro to change formula cells into values?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,038
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

I want to know if there is a better way to convert a range of cells from formulas to values other then the copy paste value method I use at the moment,
Currently I use this in my macro

Code:
    Sheets("Dashboard WK").Range("C14:T33").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

But I'm thinking there must be a more correct way to do this,

the reason I ask is I've got loads of these type odes in my spreadsheet and it makes the macro run slow as its having to got to the sheet select the area copy and paste,

is there a better way to do this?

any ideas would help

thanks

Tony
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Mike LH

Well-known Member
Joined
Mar 17, 2015
Messages
566
Hi,

I would do it like this, it's faster because there's no selecting going on. You don't even need to activate the worksheet.


Code:
With Sheets("Dashboard WK").Range("C14:T33")
    .Value = .Value
End With
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
18,716
Office Version
  1. 2013
Platform
  1. Windows
Mike has a good ideal. Here is mine.
Code:
Sheets("Dashboard WK").Range("C14:T33").Value = Sheets("Dashboard WK").Range("C14:T33").Value
 

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,038
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Thank you very much,
Mike thats a great solution will help me a lot, now all I have to do is replace all the code with the new code :)
My Aswer is, thanks for your input good to know I can do it that weay as well
thank guys

Tony
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,682
Messages
5,838,787
Members
430,568
Latest member
bortey

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
Top