"The Ring has passed beyond his help"
Although he did what he could indirectly, there was no way Gandalf could directly help Frodo any longer as he himself states:
The Ring now has passed beyond my help, or the help of any of the Company that set out from Rivendell. Very nearly it was revealed to the Enemy, but it escaped. I had some part in that: for I sat in a high place, and I strove with the Dark Tower; and the Shadow passed. Then I was weary, very weary; and I walked long in dark thought.
The Two Towers - Book Three: Chapter 5, The White Rider
He informs us that though he wasn't with the Company of the Ring he has aided them from a distance. However, what this "High place" was is unknown to us, however we are led to believe it was just before the Breaking of the Fellowship when Frodo was on the seat of Amon Hen
After acknowledging what's happened with Frodo, Gimli asks for more information, but Gandalf is unable to provide any more.
'Then you know about Frodo!’ said Gimli. ‘How do things go with him?’
‘I cannot say. He was saved from a great peril, but many lie before him still. He resolved to go alone to Mordor, and he set out: that is all that I can say.’
'Not alone,’ said Legolas. ‘We think that Sam went with him.’ ‘Did he!’ said Gandalf, and there was a gleam in his eye and a smile on his face. ‘Did he indeed? It is news to me, yet it does not surprise me. Good! Very good! You lighten my heart.
Although he is aware of Frodo's departure, he seems unaware that he has company. In finding out that Sam has gone with him Gandalf's heart "lightens". It also leads onto my next point that he has no knowledge of the Company of the Ring after Amon Hen, and therefore would have to search to find them.
Leading on from earlier, besides the fact Gandalf looking for them would make it easier for Sauron to find them, 1. by pointing out where they're not and 2. an Istari and known guide of the Fellowship going towards the Hidden Stairs and Cirith Ungol would be oddly suspicious, without the Ring nearby he couldn't be tempted by it.
‘No,’ he said in a soft voice, ‘it has gone beyond our reach. Of that at least let us be glad. We can no longer be tempted to use the Ring. We must go down to face a peril near despair, yet that deadly peril is removed.’
Back to indirectly helping, Gandalf knows that Sauron believes no one could destroy the Ring, and that the only plausible cause of action would be to take it to Minas Tirith and try to use it's power. In doing so, he draws Sauron's attention away from his borders, and makes it easier for Sam and Frodo to complete their task. (Recall in RotK when they walk for days through Mordor without seeing anyone).
[Sauron] supposes that we were all going to Minas Tirith; for that is what he would himself have done in our place. And according to his wisdom it would have been a heavy stroke against his power. Indeed he is in great fear, not knowing what mighty one may suddenly appear, wielding the Ring, and assailing him with war, seeking to cast him down and take his place. That we should wish to cast him down and have no one in his place is not a thought that occurs to his mind. That we should try to destroy the Ring itself has not yet entered into his darkest dream. In which no doubt you will see our good fortune and our hope. For imagining war he has let loose war, believing that he has no time to waste; for he that strikes the first blow, if he strikes it hard enough, may need to strike no more. So the forces that he has long been preparing he is now setting in motion, sooner than he intended. Wise fool. For if he had used all his power to guard Mordor, so that none could enter, and bent all his guile to the hunting of the Ring, then indeed hope would have faded: neither Ring nor bearer could long have eluded him. But now his eye gazes abroad rather than near at home; and mostly he looks towards Minas Tirith. Very soon now his strength will fall upon it like a storm.'
Gandalf's mind is set, he knows what he must do, and although the Ruling Ring is of primary concern to complete the task he was sent to do, he cannot do so without the help of the Free People's of Middle-earth. And so he sets out to aid Edoras and in turn Minas Tirith, in doing so, distracting Sauron from Mordor and allowing the Hobbits to destroy the Ring.