When copying 2 worksheets update formulas

jtrib84

New Member
Joined
Mar 6, 2009
Messages
3
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
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,191,165
Messages
5,985,036
Members
439,935
Latest member
Monty238

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top