aqeelnokia99
Board Regular
- Joined
- Dec 23, 2018
- Messages
- 145
- Office Version
- 2013
- Platform
- Windows
Hello Expert ,
i am looking @ VBA which Copy sheet into new workbook and make all formula and VBA as a value i found this on internet but its not make VBA result as Value
========
ON Sheet
========
Sub Seperate_Sheets()
Dim Path1 As String
Dim wb As Workbook
Dim part1 As String
part1 = Range("C2").Value
Path1 = "C:\" & part1 & " Costing.xlsx"
Sheets(Array("M C €")).Copy
Set wb = ActiveWorkbook
BreakAllLinks wb
wb.SaveAs Filename:=Path1, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub
==========
on madule
==========
Sub BreakAllLinks(ByVal wb As Object)
Dim Link As Variant, LinkType As Variant
For Each LinkType In Array(xlLinkTypeExcelLinks, xlOLELinks, xlPublishers, xlSubscribers)
If Not IsEmpty(wb.LinkSources(Type:=LinkType)) Then
For Each Link In wb.LinkSources(Type:=LinkType)
wb.BreakLink Name:=Link, Type:=LinkType
Next Link
End If
Next LinkType
wb.UpdateLinks = xlUpdateLinksNever
End Sub
i am looking @ VBA which Copy sheet into new workbook and make all formula and VBA as a value i found this on internet but its not make VBA result as Value
========
ON Sheet
========
Sub Seperate_Sheets()
Dim Path1 As String
Dim wb As Workbook
Dim part1 As String
part1 = Range("C2").Value
Path1 = "C:\" & part1 & " Costing.xlsx"
Sheets(Array("M C €")).Copy
Set wb = ActiveWorkbook
BreakAllLinks wb
wb.SaveAs Filename:=Path1, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub
==========
on madule
==========
Sub BreakAllLinks(ByVal wb As Object)
Dim Link As Variant, LinkType As Variant
For Each LinkType In Array(xlLinkTypeExcelLinks, xlOLELinks, xlPublishers, xlSubscribers)
If Not IsEmpty(wb.LinkSources(Type:=LinkType)) Then
For Each Link In wb.LinkSources(Type:=LinkType)
wb.BreakLink Name:=Link, Type:=LinkType
Next Link
End If
Next LinkType
wb.UpdateLinks = xlUpdateLinksNever
End Sub