break links selected cells VBA

samidodger

New Member
Joined
Sep 14, 2010
Messages
13
Hi there,

in my workbook I have in sheet1 in selected cells links to a file called M11 PMO.xlsx. In sheet2 I also have selected cells (as in P6, P9, P12 and so on) with links to the same file. These are just links no formula in them.

I could go to Data edit links, but that would valuerise the links in sheet one.I could copy and past values, in sheet 2 but this doesnt work on multiple cells. Is there a way through VBA or any other way to break the links in just sheet 2, on just those cells (P6, p9, p12 and so on) and convert the data to values?

Also how would the code change if the cells were random?

using Excel 2007

Long query but at least its challenging. :)
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

njimack

Well-known Member
Joined
Jun 17, 2005
Messages
7,761
You can convert them to values, but this will overwrite any formulae in your selection to values...

Code:
Sub Paste_Value()

Dim r As Range

For Each r In Selection
    r.Formula = r.Value
Next r

End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,099,739
Messages
5,470,455
Members
406,700
Latest member
Mark Rob

This Week's Hot Topics

Top