Rick,I must admit, though, that I was a little disappointed with how the above works... I had hoped besides pushing values into "foreign" cells, that it would be possible to affect other environmental properties via the subroutine called by the HYPERLINK function when evaluated by the Evaluate function, but unfortunately, it does not appear so... all attempts to do things like change the "foreign" cell's interior fill color or font color failed (no errors were raised, the code lines attempt to do this were simply ignored). Oh well, what it can do is still pretty neat, I just wished it could have been neater.
This worked for me
M.Code:Sub TooCool(InCell As Range, PushTo As Range) PushTo.Value = "The square of " & InCell.Value & " (in " & _ InCell.Address(0, 0) & ") is " & InCell.Value ^ 2 & "." PushTo.Interior.Color = vbYellow PushTo.Font.Color = vbRed End Sub Function DoCool(Rng As Range) As String If Rng.Value < 0 Then DoCool = "Number in " & Rng.Address(0, 0) & " is less than zero." Else DoCool = "Number in " & Rng.Address(0, 0) & " is greater than, or equal to, zero." End If Evaluate "HYPERLINK(TooCool(" & Rng.Address & ",J3))" End Function




Reply With Quote

Bookmarks