hello all...i'm having an issue with a macro i have in a spreadsheet.
i am trying to copy two worksheets in a spreadsheet. Worksheet 2 has formulas that link to the worksheet 1. when i copy both worksheets, i want the formulas in worksheet 4 to link to worksheet 3. i want to be able to do this on a repeated basis. below is the VBA code i have thus far that copies the two worksheets. any ideas on how to update the formulas when copying the worksheets?
Sub AddSheet2()
'
'
Application.ScreenUpdating = False
Dim L As Integer
Dim cell As Range, n As Variant
Sheets(Array(3)).Select
L = Worksheets.Count
ActiveSheet.Copy after:=Sheets(L)
Sheets(Array(4)).Select
L = Worksheets.Count
ActiveSheet.Copy after:=Sheets(L)
End Sub
i am trying to copy two worksheets in a spreadsheet. Worksheet 2 has formulas that link to the worksheet 1. when i copy both worksheets, i want the formulas in worksheet 4 to link to worksheet 3. i want to be able to do this on a repeated basis. below is the VBA code i have thus far that copies the two worksheets. any ideas on how to update the formulas when copying the worksheets?
Sub AddSheet2()
'
'
Application.ScreenUpdating = False
Dim L As Integer
Dim cell As Range, n As Variant
Sheets(Array(3)).Select
L = Worksheets.Count
ActiveSheet.Copy after:=Sheets(L)
Sheets(Array(4)).Select
L = Worksheets.Count
ActiveSheet.Copy after:=Sheets(L)
End Sub