Movement of materials into or out of a cell that requires the use of energy by the cell.