1 Reply Latest reply on Nov 2, 2012 4:39 AM by MaBUa

    Excel spreadsheet SORT method

    MaBUa

      Hi All,

      can you please help me?

      I modify one old tutorial script from mentor Graphics (ExcelCompList.vbs..... Author: Toby Rimes...about 2007).

      It generates an Excel file with list of used components and their coordinates, partname and so on.

      I added a short subroutine which select all the cells which need to be sorted (see on the picture).

      I need to SORT the table now... 1.side column and second past PARTNUMBER column.

      Can somebody help me with the rest of the vbscript?

      Many thanks

      Martin

        • 1. Re: Excel spreadsheet SORT method
          MaBUa

          I have solved it

          my subroutine now looks like this:

           

              Const xlAscending = 1 'represents the sorting type 1 for Ascending 2 for Desc

              Const xlDescending = 2

              Const xlNo = 0

              Const xlYes = 1

           

                  cmpListSheetObj.range(REFDES_COL & HEADER_ROW,SIDE_COL & rowInt-1).Sort _

                  cmpListSheetObj.Range(SIDE_COL & HEADER_ROW),xlAscending,_

                  cmpListSheetObj.Range(PARTNAME_COL & HEADER_ROW), ,xlAscending, ,_

                  , xlYes

          '        excelAppObj.range(REFDES_COL & HEADER_ROW,SIDE_COL & rowInt-1).Select()

           

          Martin