IconizeNamedWks (macro)

Checks to see if a worksheet named winName exists. If a worksheet with the name winName exists, it minimizes it. If a worksheet with the name winName does not exist, it creates one and then minimizes it.

 

Definition:

Def  IconizeNamedWks {
      if (exist(%1)==2) {
            win -o %1 {win -i};
      }
      else {
            win -n data %1;
            win -i;
      };
};

Example:

Assuming that no worksheet with the name MyData1 exists, the following script creates a worksheet named MyData1 and then minimizes it.

IconizeNamedWks MyData1;