When referring to what was said before when answering a question, yes. At least I can't think of a counter example at the moment. The other possibility would be to use the relative pronouns que or ce que, but they are used in a slightly different context, like in the example below.
I agree with what you said. -- Je suis d'accord avec ce que tu as dis.