Let's get that POT out of the circuit, to avoid confusion. Set the POT's wiper all the way to the bottom. The feedback resistors (240K or 24K) are connected directly to OpAmp's Vout. The POT is merely one of the loads on the OpAmp, and does not affect the feedback (until we start moving the wiper).
Have you worked with "virtual Ground" of OpAmps, as clean way to predict Gain?
Well, here goes.
Our circuit is 1MOhm from input to Pin- of Opamp, and 24Kohm from Pin- to Vout of OpAmp. Assume the OpAmp has infinite gain, thus even a tiny voltage on Pin- is adequate to make the OpAmp's Vout be whatever V is needed.
Assume +1volt on input to 1Mohm. Assume Pin- is at ZERO volts (good assumption).
We get 1microAmpere flowing, the OpAmp's Pin- rises toward that same 1volt, and the OpAmp's Vout starts heading toward -infinity (we have an inverting circuit).
As Vout reaches -0.024 volts, the troublesome 1microAmpere now flows thru the 24Kohm, and the OpAmp stabilizes............VOut at 0.024 volts. The Pin- voltage is.......... 0.024 volts / infinite_gain, or ZERO volts, our Virtual Ground. Our gain is 24K/1M = 0.024, or approximately 40:1 (32dB attenuation).
Lets consider that POT again. Put the wiper at 50%. We still need the 1uA to flow, so the OpAmp's Vout must "double (close to)", to 0.048 volts. Of course, Ohms Law tells us there is lots of error voltage in this analysis, because 1uA * 1/2 of the POT's resistance is 1uA * 25K or 25milliVolts, or 0.025 volts, an error trying to hide somewhere.