While I was waiting, I found a UDF that works pretty well.
Function PrevSheet(rg As Range)
n = Application.Caller.Parent.Index
If n = 1 Then
PrevSheet = CVErr(xlErrRef)
ElseIf TypeName(Sheets(n - 1)) = "Chart" Then
PrevSheet = CVErr(xlErrNA)
Else
PrevSheet = Sheets(n - 1).Range(rg.Address).Value
End If
End Function
And then on the spreadsheet, I'm using this formula.
I have since discovered that B5 is not always the right cell since there may be more data some months. So I really need to incorporate some kind of EndUp type of statement so that instead of B5, I'm referencing the last cell in the column with data. How can I do that?
Bookmarks