I have a HP EliteBook 2540p and I am trying to connect two external monitors to it, but I'm having difficulties. I have a VGA splitter to connect the two monitors. The external monitors have cloned displays whereas the laptop is part of the extended desktop. How can I fix this so as to make use of the two external monitors with the extended desktop setting?
A VGA splitter cable only replicates the video output on both connected displays, it doesn't allow you to use both displays independently. To have two external monitors connected to the 2540p with the desktop extended to both, you need to connect one by VGA and the other by DisplayPort. Note that doing so will disable the laptop's built-in display, as the 2540p is not capable of driving three displays at once, at least not without adding additional graphics hardware (like a USB video adapter or an external GPU via ExpressCard).
This is the guide you're looking for:
I think these two excerpts are particular interesting in regards to your question:
Also, take a look at the table for your model under the "Display resolution specifications" section