s6y United Bankshares Inc S-3ASR

United Bankshares Inc S-3ASR, filed Nov 10, 2016: Consent of experts

Exhibit 23.2

Consent of Independent Registered Public Accounting Firm

We consent to the reference to our firm under the caption “Experts” in the Registration Statement (Form S-3) and related Prospectus of United Bankshares Inc. for the registration of common stock, preferred stock, debt securities, rights, warrants, depository shares, and units, and to the incorporation by reference therein of our reports dated February 29, 2016, with respect to the consolidated financial statements of United Bankshares, Inc., and the effectiveness of internal control over financial reporting of United Bankshares, Inc., included in its Annual Report (Form 10-K) for the year ended December 31, 2015, filed with the Securities and Exchange Commission.

/s/        ERNST & YOUNG, LLP

Charleston, West Virginia

November 10, 2016