From Formula to Value

A

aw

Can anyone can help how to write the VB code by using of :

“For Each†& “Select Case†for the purpose of changing all its formula into
value in selected cells / area.

In addition, it will not get an error message in case of ‘value’ the cells
with 'text'.

Thx a lot!
 
R

Rick Rothstein

You don't need For Each and Select Case to do that. Select your cells and
then simply execute this single statement...

Selection.Value = Selection.Value
 
A

aw

It works if it is in regular area.

However it can't work if it is in mutiple cells / area not in regular by one
time.

For example, select cells N9..P10, R10..R11 & S20..T21 at a time.
 
R

Rick Rothstein

Give this code a try then...

For Each A In Selection.Areas
A.Value = A.Value
Next
 
Top