hi, might be from an inflammed liver, gallbladder, or diaphram.
I have just been through exhaustive tests - CT scan, ultrasound, endoscopy and colonoscopy with everything normal. For a year I have had a constant pain under my right rib. aggravated whether I eat or not, whether Im sitting still or moving. However bending over to pick things up made it worse. We have narrowed it down to the rectus abdominus muscles that run along the torso under the ribs. Once you strain them they can give symptoms such as Nausea, vomiting, weight loss,Diarrhea, constipation or change in bowel habits, Pain not made better or worse by eating or bowel movements, Jaundice or other liver function test abnormalities, Bleeding or anemia, Fever. Unbelievable huh?... I am a slim, active person but have been sore for a year - not knowing how I have done this originally. The specialist has injected the area with a local anesthetic and in a couple of weeks will inject some steroids so as to stop the muscles spasming if they havent already. Hope this helps.