JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,532
- Office Version
- 365
- Platform
- Windows
I have no idea what's happening here. I am hoping someone can enlighten me.
I am working on a workbook to help me keep track on insulin injections. Part of it is generating a rotating schedule of finger-priick (*) locations for blood glucose readings.
* I had to spell it that way to keep it from getting bleeped
I came up with a schedule based on clock positions so that any particular site is only used once every 12 days. The site on each finger will cycle around the clock positions by 5s: 1 - 6 - 11 - 4 - 9 - 2 - 7 - 12 - 5 - 10 - 3 - 8 - 1 ... and the fingers will cycle from 1 - 2 - 3 - 4 - 5 - 1...
I wrote a little UDF that will generate a repeating cycle of fingers and sites. Here's that code:
The code has worked perfectly for months. But today, I tried changing the address of the cell containing the previous site from relative to half absolute and it blew up. Here's some sample output:
C4 contains a literal for the starting site ("3-5" means 5 o'clock on finger #3). C5-C9 contain the sequence of sites that are the results of the UDF. C10 should do the same, but when I change the cell reference from C15 to $C15, the result is some weird link. If I hover over it, I get a pop-up that says something about "mailto:". If I click on it, it opens up an Outlook email addressed to that link.
What the heck is going on?
I am working on a workbook to help me keep track on insulin injections. Part of it is generating a rotating schedule of finger-priick (*) locations for blood glucose readings.
* I had to spell it that way to keep it from getting bleeped
I came up with a schedule based on clock positions so that any particular site is only used once every 12 days. The site on each finger will cycle around the clock positions by 5s: 1 - 6 - 11 - 4 - 9 - 2 - 7 - 12 - 5 - 10 - 3 - 8 - 1 ... and the fingers will cycle from 1 - 2 - 3 - 4 - 5 - 1...
I wrote a little UDF that will generate a repeating cycle of fingers and sites. Here's that code:
VBA Code:
Function FingerLoc(pLast As String) As String
Dim parts
Dim finger
Dim clock
parts = Split(pLast, "-")
finger = (parts(0) Mod 5) + 1
If finger = 1 Then
clock = ((parts(1) + 4) Mod 12) + 1
Else
clock = parts(1)
End If
FingerLoc = finger & "-" & clock
End Function
The code has worked perfectly for months. But today, I tried changing the address of the cell containing the previous site from relative to half absolute and it blew up. Here's some sample output:
C4 contains a literal for the starting site ("3-5" means 5 o'clock on finger #3). C5-C9 contain the sequence of sites that are the results of the UDF. C10 should do the same, but when I change the cell reference from C15 to $C15, the result is some weird link. If I hover over it, I get a pop-up that says something about "mailto:". If I click on it, it opens up an Outlook email addressed to that link.
What the heck is going on?