If Worksheets(1).Range("A1").Sort is given, the single cell range A1 should be expanded to the Range.CurrentRegion contiguous data area, same as if Sort was invoked by UI and Excel does in VBA. RFE created from https://ask.libreoffice.org/t/microsoft-excel-vba-sort-function-which-works-with-libreoffice-calc-without-modification/78606 See also https://docs.microsoft.com/en-us/office/vba/api/excel.range.sort https://docs.microsoft.com/en-us/office/vba/api/excel.range.currentregion
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/14ce950083cab9ca8067f36dc08ca5bfb33ae046 Resolves: tdf#149579 Expand Range.Sort single cell to Range.CurrentRegion It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-7-4": https://git.libreoffice.org/core/commit/7c34db88f3ee99dbb495f3643ab956d7467d5e00 Resolves: tdf#149579 Expand Range.Sort single cell to Range.CurrentRegion It will be available in 7.4.0.0.beta2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/bf195037e2e59c46a8b7d149aedb79357e5ea978 tdf#149579: sc_vba_macro_test: Add unittest It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Created attachment 180838 [details] TestcaseVBASort.xls Attached file is a testcase that produces the same results with MS Excel 2010 and LO Calc 7.5.0.0.alpha0+ ca47989ad60b1414f92be22a1fbf4c1d1a92dd97. Verified fixed. Thank you
1. Should this enhancement be added to the "LibreOffice 7.4 Community: Release Notes" at: https://wiki.documentfoundation.org/ReleaseNotes/7.4#VBA_Support ? 2. Does this enhancement need to go into the LO Help file? 3. Should LO BASIC also automagically* expand the region if only 1 cell is selected? If so, should new issue be created? Thank you *automagically https://ask.libreoffice.org/t/microsoft-excel-vba-sort-function-which-works-with-libreoffice-calc-without-modification/78606/5
(In reply to Óvári from comment #5) > 1. Should this enhancement be added to the "LibreOffice 7.4 Community: > Release Notes" at: > https://wiki.documentfoundation.org/ReleaseNotes/7.4#VBA_Support > ? Done. Feel free to update as required. Thank you