you can record the manual actions with the macro-recorder.

then you get the VBA code.