Can't get 2 variables to work globally - out of scope error and ThingSpeak error

Thank you! That worked a treat!

I'm learning as I go. I'll be sure to do more reading. Thank you again.