You can regard the matrix as three 8x8 matrices which share the row pins (common anode). To drive 1 matrix you would use a 3-to-8 demultiplexer to drive one row, and pull the cathodes low for the LEDs in that row you want to light up. Note that the outputs of the demultiplexer have to drive up to 8 LEDs in one matrix, and even up to 24 LEDs in an RGB matrix. They can't supply the required current, so you'll need transistors to boost the current.
For one matrix this would require 3 + 8 pins, which is well within the Arduino's capabilities. For 3 matrices, however, you would need 3 + 3 * 8 = 27 pins, and that's too many.
Solution: instead of connecting the 8 cathodes directly to the Arduino, use a latched shift register like the 74HC595. It only requires 3 pins (data, clock and latch) and you can cascade them, so that you only need 3 + 3 pins from Arduino.
Algorithm:
- shift 24 "1"s in the HC595s to turn the LEDs off
- latch the HC595s
- select next row (next binary value to demultiplexer
- shift the 24 bits for the new row (8 red, 8 green, 8 blue) into the HC595s
- latch the HC595s to activate the LEDs
- wait for next scan line, 1ms is a good time