[Solved] fpspread: any method to make range address in order lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- kjteng · 2018-05-27 08:58 I think there is a method/function that will  change cell range  from 'B3:A1'  to  'A1:B3' but I could not find it. Any clue? Thanks ---------------------------------------------------------------------- wp · 2018-05-27 09:18 There's no direct method available. You must use the formula parser to split the adress into parts and have it reassemble them: 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 uses  fpsExprParser; function FixCellRange(AWorksheet: TsWorksheet; ARangeStr: String): String;var  parser: TsSpreadsheetParser;begin  parser := TsSpreadsheetParser.Create(AWorksheet);  try    parser.Expression := ARangeStr;    Result := parser.Expression;  finally    parser.Free;  end;end;  procedure TForm1.Button1Click(Sender: TObject);begin  ShowMessage(FixCellRange(WorksheetGrid.Worksheet, 'C3:A1'));end; I am not sure if this is working in the release version because I changed a lot with the formula parser recently. ---------------------------------------------------------------------- kjteng · 2018-05-27 10:48 yes. it works in trunk version. I actually wrote my function as follows 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  uses  fpsUtils, fpsTypes;  function FixCellRange(AN: string): string;var cr: TsCellrange;    procedure Check(var a, b: cardinal);    var ii: cardinal;    begin      if a > b then        begin          ii := a; a := b; b := ii        end;    end;begin  ParseCellRangeString(AN, cr);  with cr do    begin      check(Col1, Col2);      check(Row1, Row2);  end;  Result := GetCellRangeString(cr);end; ---------------------------------------------------------------------- wp · 2018-05-27 11:29 Yes, of course. This is better because it does not require a worksheet