Hi Bob,
The main issue was that you hadn't closed off the Select Case statement.
Post back re how the following goes (note that I've included the relevant udf by cpearson for an entire working solution):
Sub test()
For Each Worksheet In Worksheets
Select Case Worksheet.Index
Case 1, 2, 3
'Do Nothing
Case Else
Worksheets(Worksheet.Index).Range("I37").Formula = "=RefOnPrevSheet(""I39"")"
End Select
Next Worksheet
End Sub
Function RefOnPrevSheet(Addr As String) As Variant
Application.Volatile True
With Application.Caller.Parent
If .Index = 1 Then
RefOnPrevSheet = _
.Parent.Worksheets(.Parent.Worksheets.Count).Range(Addr).Value
Else
RefOnPrevSheet = .Previous.Range(Addr).Value
End If
End With
End Function
HTH
Robert
Bookmarks