I can't find the capacitance value to use for a PIC18F MCU clocked at 40MHz.
I see that from 1MHz up to 25MHz Microchip is proposing 15pF. But no mention for 40MHz.
Usually the 40MHz clock for 18F series PIC comes from a 10MHz crystal and activating the internal PLL that multiplies the 10MHz by 4. Check the datasheet to be sure.