Underwater localization is a challenging problem and established technologies for terrestrial systems cannot be used, notably the Global Positioning System (GPS). In this paper, we propose an underwater localization technique and demonstrate how it can be effectively used for transmit beamforming in multiuser underwater acoustic (UWA) communications. The localization is based on pre-computation of acoustic channel parameters between a transmitter-receiver pair on a grid of points covering the area of interest. This is similar to the localization process using matched field processing, which is often based on processing a priori unknown signals received by an array of hydrophones. However, in our case, every receiver is assumed to have a single hydrophone, while an array of transducers transmit (pilot) signals known at a receiver. The receiver processes the received pilot signal to estimate the Channel State Information (CSI) and compares it with the CSI pre-computed on the grid; the best match indicates the location estimate. The proposed localization technique also enables an efficient solution to the inherent problem of informing a transmitter about the CSI available at the receiver for the purpose of transmit beamforming. The receiver only needs to send a grid point index to enable the transmitter to obtain the pre-computed CSI corresponding to the particular grid point, thereby significantly reducing transmission overheads. We apply this approach to a multiuser communication scenario with orthogonal frequency-division multiplexing (OFDM) and show that the proposed approach results in accurate localization of receivers and multiuser communications with a high detection performance.