Avatar of brothertruffle880
brothertruffle880
Flag for United States of America asked on

Excel 2010 VBA - convert formula in a cell into the value of that formula.

I would like to have VBA code do the following:
1.  edit the current cell (F2).
2.  turn the formula inside that cell into the final value (press F9)
3.  move down to next cell.
4.  If the next cell is empty.  end execution of macro.
Microsoft ExcelVB ScriptVisual Basic.NET

Avatar of undefined
Last Comment
Saqib Husain

8/22/2022 - Mon
Saqib Husain

Does this have to be like that?

You can do it without a macro using copy/paste-values.

If if has to be a macro you can have something like

Sub cnv2values()
dim rng as range
set rng=range(selection,selection.end(xldown))
rng.value=rng.value
end sub
brothertruffle880

ASKER
Thanks!

How would I add:

Selection.Hyperlinks.Delete

to your code?

I would like the hyper links to be removed from the cells also.
ASKER CERTIFIED SOLUTION
Saqib Husain

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes