Recent

Author Topic: [solved] How to activate/show/focus cells  (Read 1265 times)

Raumgleiter

  • Newbie
  • Posts: 2
[solved] How to activate/show/focus cells
« on: November 23, 2023, 08:28:34 pm »
Hello forummembers,

I use the FPSearchengine to find cells in a workbook with a couple of worksheets.
The result of the search is stored in a stringlist with the information of cell and worksheet
Now I try to "search backwards". That means, I will show  the found cell/worksheet on screen.
I have no problems to show the found worksheet, but if I try to show/focus/activate the found cell on screen I fail.
I see one of the cells in the found worksheet but not the found one from the stringlist.

My question: How to show/focus/activate a cell on a shown worksheet.

Thanks in advance.
« Last Edit: November 29, 2023, 07:44:01 am by Raumgleiter »

wp

  • Hero Member
  • *****
  • Posts: 12464
Re: How to activate/show/focus cells
« Reply #1 on: November 27, 2023, 12:13:04 am »
Code: Pascal  [Select][+][-]
  1. // Select cell B5
  2. // "B5" is in the worksheet in row 4 and column 1
  3. // Note: this is different in the grid which is offset by the fixed rows/cols
  4. procedure TForm1.Button1Click(Sender: TObject);
  5. begin
  6.   sWorksheetGrid1.Worksheet.SelectCell(4, 1);
  7.   // or
  8.   {
  9.   sWorksheetGrid1.Col := 2;
  10.   sWorksheetGrid1.Row := 5;
  11.   }
  12. end;

Raumgleiter

  • Newbie
  • Posts: 2
Re: How to activate/show/focus cells
« Reply #2 on: November 28, 2023, 06:07:24 pm »
Thanks WP,

your help solves my problem.

 

TinyPortal © 2005-2018