You can answer this question by considering the ratio of similar triangles:
In 12 inches, the ramp rises 1 inch-- > 12/1
In x inches, the ramp must rise 18 inches --> x /18
Both of these triangles have concruent angles. Therefore their ratios are equal:
12/1 = x / 18
x = 12*18 = 216 inches = 18 feet
Assuming that you are going to go with a single straight ramp with a constant slope (which you probably wouldn't, but we'll assume), all you have to do to find this is to multiply 12 (which is of course 1 foot) by 18. The reason for this is that you need 12 inches of "run" for every inch of "rise."
So the answer to this is that you need to have the end of the ramp be 18 feet from the base of the building.
If you need the answer to be in inches, you multiply 18 by 12 and you get 216 inches.