VBA Question - Bernie Deitrick helped me previously

R

robert morris

I have a Workbook (w/b) with 50 odd Worksheets (w/s)starting with a
"Summary" w/s and a blank "Master w/s" which is copied for each new name
added. VBA as follows;

Sub MakeLinks()
Dim myR As Long
With Worksheets("Standings")
myR = .Range("F" & Rows.Count).End(xlUp)(2).Row
..Range("F" & myR).Formula = "='" & ActiveSheet.Name & "'!M75"
..Range("H" & myR).Formula = "='" & ActiveSheet.Name & "'!D75"
..Range("I" & myR).Formula = "='" & ActiveSheet.Name & "'!F73"
..Range("J" & myR).Formula = "='" & ActiveSheet.Name & "'!H73"
..Range("K" & myR).Formula = "='" & ActiveSheet.Name & "'!J73"
..Range("L" & myR).Formula = "='" & ActiveSheet.Name & "'!L73"
..Range("M" & myR).Formula = "='" & ActiveSheet.Name & "'!M71"
..Range("C" & myR).Formula = "='" & ActiveSheet.Name & "'!B2"
End With
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Address = "$B$2" Then Sh.Name = Target.Value
End Sub

Macro is - Sheet2.MakeLinks - Macros in: This Workbook

This all works beautifully! My problem is; I have now started a new File
by copying the original for a new Region. This new file does not work. VBA
keeps using file names fom the original and will not post. Everything in the
New File is indentical except names. I DO NOT want the two Files to link to
each other.

Obviously, after I copied the original, VBA will not allow me to use same
VBA. I am getting an Error #400

Can anyone help?

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top