Solved

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

Posted on 2014-01-12
3
793 Views
Last Modified: 2014-01-12
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.
0
Comment
Question by:brothertruffle880
  • 2
3 Comments
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39774592
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
0
 

Author Comment

by:brothertruffle880
ID: 39774611
Thanks!

How would I add:

Selection.Hyperlinks.Delete

to your code?

I would like the hyper links to be removed from the cells also.
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 39774616
Try

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question