I have two columns with cells linked to another workbook, I would like to convert those cells to values. Problem is that they are not connected (after every couple of rows there is a sum function which I would like to stay intact), so I can not use line .Value = ...Value in VBA.
Cells that needs to be converted to values are selected with macro that selects unlocked cells.
I could write manual macro for every few cells with Value/Value line, but I'm sure that there is an easier way.
Cells that needs to be converted to values are selected with macro that selects unlocked cells.
Code:
Sub SelectUnlockedCells()
Dim WorkRange As Range
Dim FoundCells As Range
Dim Cell As Range
Set WorkRange = ActiveSheet.UsedRange
For Each Cell In WorkRange
If Cell.Locked = False Then
If FoundCells Is Nothing Then
Set FoundCells = Cell
Else
Set FoundCells = Union(FoundCells, Cell)
End If
End If
Next Cell
If FoundCells Is Nothing Then
MsgBox "All cells are locked."
Else
FoundCells.Select
End If
End Sub
I could write manual macro for every few cells with Value/Value line, but I'm sure that there is an easier way.