Ah, how we love out Kitties. I am sitting here with my old male cat on my lap who is currently sick (and under the vets care) and thinking about how much I love this silly animal.
All cats get hairballs - a side effect of grooming. I feed mine Iams hair ball control formula. It is more expensive than, say, Purina, but less expensive than Science Diet, and Target often has it on sale. With that being said, my vet has instructed me to take my old male kitty off of it because it has a higher fat content and it is harder for the liver to process (and he is having liver probs right now). Since he is sooo sick right now, I am feeding only Science Diet WD, canned food. If he improves he will switch to the WD dry. I just feed him separate from the other kitties right now and instead of leaving food out all day they are all getting fed two/three times a day in separate rooms. It is a pain to separate the cats and feed them, but after a couple of days they get used to it and it becomes easier.
As far as I know, Science Diet will not "cure" hairballs - but since there are several formulas, there are some types that are easier for cats to digest, which becomes especially important in our older Kitties. Most commercial foods have higher fat, magnesium, and crude protein contents than Science Diet and this can cause stomach, stool, liver, and kidney problems in older cats. I have had cats on and off SD for years, and while pricey, I find that it really is a superior cat food and has helped many of my cats, through the years, be healthier and/or recover from illnesses. I am resigned, at this point, to having at least two cats on it for the remainder of their lives. I just will not eat out as often in order to purchase their food. LOL
Also, I remember, years ago, my vet (I think) gave me a medicine in a tube, that helped cats pass hairballs, thereby limiting the vomiting caused by hairballs. Check with your vet again, or check at PetSmart. I know there are other treatments out there.
Oh, when you take her to the vets ask them to clip the hair around her, ahem, backside. Long hairs are prone to the problem and buzzing the hair there and on the underside of her tail will help keep her clean.
Good Luck and God Bless you and your kitties (and your little dog too!!!)