Solved

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

Posted on 2014-01-12
3
806 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

Suggested Solutions

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

730 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