Devin
Board Regular
- Joined
- Jan 21, 2009
- Messages
- 105
I have a solution to my problem, but I am wondering if there is any other/easier way to solve it. Thanks.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
I need to create a new sheet copied from the following sheet:
‘Sheet Two’, cell “A1” = 1
‘Sheet Two’ cell “B1”, = A1+’Sheet One’!B1
When the new sheet is created, I need the reference to “Sheet One” to automatically change to “Sheet Two.”
‘Sheet Three’, cell “A1”=1
‘Sheet Three’, cell “B1”= A1+’Sheet Two’!B1
Code:
<o></o>
Sub NewSheet()
Dim OldSheet As String
OldSheet = ActiveSheet.Name
ActiveSheet.Copy After:=Sheets(OldSheet)
Range("B1").Select
ActiveCell.FormulaR1C1 = "=RC[-1]+'" & OldSheet & "'!RC"
<o></o>
End Sub
</PRE>
<!-- / message -->
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
I need to create a new sheet copied from the following sheet:
‘Sheet Two’, cell “A1” = 1
‘Sheet Two’ cell “B1”, = A1+’Sheet One’!B1
When the new sheet is created, I need the reference to “Sheet One” to automatically change to “Sheet Two.”
‘Sheet Three’, cell “A1”=1
‘Sheet Three’, cell “B1”= A1+’Sheet Two’!B1
Code:
<o></o>
Sub NewSheet()
Dim OldSheet As String
OldSheet = ActiveSheet.Name
ActiveSheet.Copy After:=Sheets(OldSheet)
Range("B1").Select
ActiveCell.FormulaR1C1 = "=RC[-1]+'" & OldSheet & "'!RC"
<o></o>
End Sub
</PRE>
<!-- / message -->