Spreading codes are an essential component of the operation of a direct sequence code division multiple access (DS- CDMA) system. The need for efficient assignment of spreading codes to transmitters can arise for two reasons. Firstly, if the number of codes available is less than the number of users, then the codes must be assigned to achieve satisfactory re-use distances. Secondly, if the correlation properties of code pairs differ from pair to pair, then assignment can be used to ensure that close users have the best correlation properties. Many code classes (e.g. Gold codes) do not display this variation from pair to pair, but others (particularly those designed for quasisynchronous operation) do. The variation can be exploited to improve the overall performance. In this paper an adaption to code assignment of the type of algorithm used for frequency assignment is described, and the potential benefits explored.