The present invention relates to methods for preparing a pharmaceutical composition for treating diabetes mellitus and the pharmaceutical composition prepared by the methods. The pharmaceutical composition of the present invention comprises extracts of the following crude drugs: 5-40 weight parts of Radix Trichosanthis (Tianhuafen), 10-30 weight parts of Radix Bupleuri (Chaihu), 3-15 weight parts of Fructus Aurantii Immaturus (Zhishi), 1-6 weight parts of Radix et Rhizoma Rhei (Dahuang), 1-12 weight parts of Rhizoma Pinelliae (Banxia), 3-15 weight parts of Radix Scutellariae (Huangqin), 1-12 weight parts of Rhizoma Coptidis (Huanglian), 3-15 weight parts of Radix Paeoniae Alba (Baishao) and 5-20 weight parts of Fructus Mume (Wumei), and optionally comprises pharmaceutically acceptable excipient. Also, the pharmaceutical composition of the present invention can further comprise Fructus Crataegi (Shanzha). Additionally, the present invention discloses four methods for preparing the pharmaceutical composition.