How to get column/row names? [SOLVED] lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- Vittorio · 2017-09-06 07:42 Is there a simple way to get column names (such as "A", "B") and row names (such as "1", "2") for WorksheetGrid cell? Thanks. ---------------------------------------------------------------------- wp · 2017-09-06 09:04 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i rowstr := IntToStr(ARowIndex+1);colStr := GetColString(AColIndex: Integer);cellStr := GetCellString(ARowIndex, AColIndex); But note that the row and column indexes refer to the worksheet, not the grid. The grid indexes will be offset by 1 if its headers are shown, i.e. if grid.ShowHeaders is true. Use the grid functions GetWorksheetCol(AGridCol) and GetWorksheetRow(AGridRow) for conversion independently of headers shown or not. For example to get the Excel notation of the currently selected grid cell: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  sheetCol, sheetRow: Integer;begin  sheetCol := grid.GetWorksheetCol(grid.Col);  sheetRow := grid.GetWorksheetRow(grid.Row);  ShowMessage('The currently selected cell is ' + GetCellString(sheetRow, sheetCol));end; ---------------------------------------------------------------------- Vittorio · 2017-09-06 09:41 Thanks a lot! ---------------------------------------------------------------------- Relativity · 2018-01-18 09:49 Is it possible to get rows' and columns' names from TsWorksheet instead of from TsWorksheetGrid ? ---------------------------------------------------------------------- wp · 2018-01-18 11:30 The row name is just the same as IntToStr(ARowIndex+1).The column name can be obtained from GetColString(AColumnIndex) (in fpsutils) ( colindex 0 --> 'A').The cell address name can be obtained from GetCellString(ARowIndex, AColIndex), in fpsutils, too (rowindex 0, colindex 0 --> 'A1'.The name of a cell range starting at top-left corner ARow1,ACol1 and ending at bottom-right corner ARow2,ACol2 can be obtained from GetCellRangeString(ARow1, ACol1, ARow2, ACol2) (--> ARow1=0, ACol1=0, ARow2=1, ACol2 = 1 --> 'A1B2') (again in fpsutils). ---------------------------------------------------------------------- Relativity · 2018-01-18 13:02 I apologize for my ill-posed question. I had not understood at all that the GetColString function etc.. are functions from the fpsutils unit. I didn't understand where these utility functions came from and I thought they were maybe TsWorksheetGrid's methods. Therefore I asked if something similar was available also in TsWorksheet. I apologize and thank you for your patience. ---------------------------------------------------------------------- wp · 2018-01-18 13:56 No need to apologize.