The short answer
No. He said he must be content to remain an agnostic. He had once trained for the Church, and lost his belief slowly, over many years.
From Paley to the wind
At Cambridge he read William Paley for his degree and found the argument from design as satisfying as Euclid. Fifty years later he wrote that it fails, now that the law of natural selection has been discovered. There seems to be no more design in the variability of organic beings, and in the action of natural selection, than in the course which the wind blows.
He did not go on to say there is no God. The mystery of the beginning of all things, he wrote, is insoluble by us.
What the family cut
When his son Francis published the autobiography in 1887, nearly six thousand words were left out, most of them about religion. Among them: that on the plain language of the text, unbelievers would be everlastingly punished, which would include his father, his brother and almost all his best friends, and that this was a damnable doctrine.
His widow Emma wrote beside the passage that she would rather it did not appear. The full text was printed only in 1958, by his granddaughter Nora Barlow.
Buried in the Abbey
He died at Down House on 19 April 1882. The family had other plans. Twenty members of Parliament wrote to the Dean of Westminster, and he was buried in Westminster Abbey on 26 April.