Use SAPGUI Scripting via the statement "ApplyGUIScript". In VBScript you then set the "selectRows" property. Example:
Set grid = session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell")
grid.selectedRows = "0-" & (grid.rowCount-1)