Exhibit 23.1 CONSENT OF INDEPENDENT AUDITORS We consent to the incorporation by reference in this Annual Report (Form 10- K) of United Bankshares, Inc. and Subsidiaries of our report dated February 25, 2000, included in the 1999 Annual Report to Shareholders of United Bankshares, Inc. and Subsidiaries We also consent to the incorporation by reference in the Registration Statements pertaining to the Incentive Stock Option Plan (Form S-8, No. 33- 22941) and the Savings and Stock Investment Plan (Form S-8, No. 33-32522) of United Bankshares, Inc. of our report dated February 25, 2000, with respect to the consolidated financial statements of United Bankshares, Inc. and Subsidiaries incorporated by reference in the Annual Report on Form 10-K for the year ended December 31, 1999. /s/ ERNST & YOUNG LLP Charleston, West Virginia March 27, 2000 80