Dear Cgirl,
I'm so very sorry to hear you've lost your grandmother. It's good that you wrote her years ago and told her how much you loved her and how important she was to you and she sure would have really appreciated your taking time to spend with her in recent months.
Words probably don't help, but I just wanted to tell you how sorry I was to read about your grandma.