Public Function rFind(SectionStart As String, SectionColumns As Integer, SectionRows As Integer, Period As Integer) As String
'find reference for the specified period in a section
Dim nRes As Single
Dim iChunk As Integer 'which chunk is this period in?
Dim iCol As Integer 'which column in the chunk?
Dim sCol As String, sRow As String 'section start seperated into col, row
Dim I As Integer
nRes = Period / SectionColumns
'returns a single, the fix part is which chunk
'the decimal part is the position in the chunk
iChunk = Fix(nRes)
iCol = (nRes - iChunk) * SectionColumns
'split the section start into col:row
sCol = "": sRow = ""
For I = 1 To Len(SectionStart)
'are we numeric?
If IsNumeric(Mid(SectionStart, I, 1)) Then
sRow = sRow + Mid(SectionStart, I, 1)
Else
sCol = sCol + Mid(SectionStart, I, 1)
End If
Next I
'return new reference
rFind = rI2C(rC2I(sCol) + iCol - 1) & CInt(sRow) + (iChunk * SectionRows)
End Function