This is the macro I'm using with 2 problems so far
Firstly the macro is deleting and replacing the worksheet in the destination workbook so I have to do find and replace any formula's I have on other worksheets that refer to the Master worksheet.
Secondly if it just pasted values and formats would that fix the links problems I seem to get when I open up the destination workbook after it has been saved as I have to answer update links continue every time?
Code:
Sub Move_Master_EstimatingSheet()
Dim SDrv As String
Dim DDrv As String
Dim Sfname As String
Dim Dfname As String
Dim wkbSrc As Workbook
Dim wkbDst As Workbook
Application.DisplayAlerts = False
Application.EnableEvents = False
SetAttr "c:\Sue\ESTIMATING SHEET.xlsm", vbNormal
SDrv = "c:\Sue\"
Sfname = "Supplier Master Price List.xl??"
DDrv = "c:\Sue\"
Dfname = "ESTIMATING SHEET.xlsm"
Set wkbSrc = Workbooks.Open(SDrv & Sfname)
Set wkbDst = Workbooks.Open(DDrv & Dfname)
Sheets("Master").Visible = True
wkbDst.Sheets("Master").Delete 'Delete List sheet from Dest
wkbSrc.Sheets("Master").Copy After:=wkbDst.Sheets("Rubber")
ActiveSheet.Protect Password:="???", DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Opt1").Select
Range("A1:X1500").Select
Selection.Replace What:="#REF!$C:$L", REPLACEMENT:="Master!$C:$L", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="#REF!$S:$AB", REPLACEMENT:="Master!$S:$AB", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Selection.Replace What:="#REF!", REPLACEMENT:="Master!$C:$L", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Worksheets("Opt1").Activate
Range("$K2").Select
Sheets("Master").Visible = False
Application.DisplayAlerts = True
ActiveWorkbook.Close SaveChanges:=True
SetAttr "c:\Sue\.xlsm", vbReadOnly
End Sub
Firstly the macro is deleting and replacing the worksheet in the destination workbook so I have to do find and replace any formula's I have on other worksheets that refer to the Master worksheet.
Secondly if it just pasted values and formats would that fix the links problems I seem to get when I open up the destination workbook after it has been saved as I have to answer update links continue every time?