Button Code to Compact Workspace

Does anyone know code or a formula that can be used in a button to compact the workspace?