16 Replies Latest reply: Sep 24, 2014 7:26 PM by Preciliano Fausto RSS

    Getting random Cell values

    Vladimir Komarov

      Hello,

       

      I am looking for the way to retrieve a cell data from Straight or Pivot tables. Basically, I need to have an option to click on the table (right click - to avoid selections, for example) and get the cell's value along with Row and Column number.

       

      Copy the cell value to clipboard will not work in my case since I need to know cell's coordinates.

       

      I need to report that specic cell (Column # = A and Row # = B) has a value = C.

       

      Is it possible?

       

      Looking forward to your suggestions.

       

      Best regards,

      Vladimir

        • Re: Getting random Cell values
          Gysbert Wassenaar

          I think the only way is to use a macro and that's only possible if you know in advance which row and column you want. There's no click event api for chart objects that can be used.

           

          Sub GetCellValue

              RowNo=6

              ColNo=2

              set obj = ActiveDocument.GetSheetObject( "CH01" )

              set cell = obj.GetCell(RowNo,ColNo)

              msgbox(cell.Text)

          end sub

            • Re: Getting random Cell values
              Vladimir Komarov

              Gysbert,

               

              Unfortunatelly, I will not know which cell customer would like to select.

              I have up to 200 columns in one chart (scrollable) and I was looking for the option to "highlight" the specific cell (or range of cells) and copy/paste them into some report (excel file, for example).

               

              But thanks for your reply.

               

              Regards,

              Vladimir

              • Re: Getting random Cell values

                If I would like to activate that cell to make that the Chart Navigate forward more associative information, what should i do?

                 

                Sub GetCellValue

                    RowNo=6

                    ColNo=2

                    set obj = ActiveDocument.GetSheetObject( "CH01" )

                    set cell = obj.GetCell(RowNo,ColNo)

                    msgbox(cell.Text)

                 

                     //Selects the cell to navigate forward in current data chart

                     cell.select(): //how to select that cell????

                 

                end sub

                • Re: Getting random Cell values

                  Gysbert.

                   

                  How could i use macro a pivot table.

                   

                  eg.

                   

                  Expression = GetCellValue(11,1)

                   

                  i sent as parameters the row and column and the function returns me the value of the cell.

                   

                  1) How to define the function

                  2) As i invoke the function