Stephen Spittal
New Member
Good Morning all,
I am having difficulties opening an Excel Workbook which has been a year in development (I know I should have made a backup), I have tried to open and repair the file however, when I do that it I loose all the formula etc. My workbook took references from multiple workbooks to produce a summary sheet.
I have used the Code below before to turn the formula in the active sheet to string so that they could be printed is there away that I can set the reference range to a workbook with the file path such as 'H:\Desktop\Type 26 Detail Design Change Management\[Stage 2 Interactive Change Management Dashboard.xlsm]Dashboard Table'!A2
Thank you all in advance
I am having difficulties opening an Excel Workbook which has been a year in development (I know I should have made a backup), I have tried to open and repair the file however, when I do that it I loose all the formula etc. My workbook took references from multiple workbooks to produce a summary sheet.
I have used the Code below before to turn the formula in the active sheet to string so that they could be printed is there away that I can set the reference range to a workbook with the file path such as 'H:\Desktop\Type 26 Detail Design Change Management\[Stage 2 Interactive Change Management Dashboard.xlsm]Dashboard Table'!A2
Code:
Sub Macro2()
Dim i As Integer
Dim targetCells As Range
Dim cell As Range
Dim referenceRange As Range
Dim thisSheet As Worksheet
Set referenceRange = activesheet.range("A2")
With referenceRange
For j = referenceRange.Parent.Index To Sheets.Count
Set thisSheet = Sheets(j)
Set targetCells = thisSheet.Cells.SpecialCells(xlCellTypeFormulas, 23)
For Each cell In targetCells
If cell.HasFormula Then
.Offset(i, 0).Value = thisSheet.Name
.Offset(i, 1).Value = cell.Address
.Offset(i, 2).Value = "'" & CStr(cell.Formula)
i = i + 1
End If
Next
Next
End With
End Sub
Thank you all in advance