Bug 164054 - Libre Calc Named Ranges
Summary: Libre Calc Named Ranges
Status: RESOLVED DUPLICATE of bug 35296
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.8.3.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: QA:needsComment
Keywords:
Depends on:
Blocks: Cell-Name
  Show dependency treegraph
 
Reported: 2024-11-26 03:49 UTC by ash
Modified: 2025-01-24 12:41 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ash 2024-11-26 03:49:30 UTC
Description:
When creating Named Ranges using Sheet>Named Ranges & Expressions>Manage there is no was to specify multiple ranges. This is straight forward in Excel.
While moving a sheet from Excel to Libre I notice this, a sheet button which referenced cells $J$16, $C$20 and $B$27:$I47 no longer high lighted those sells when pressed. The reason for selecting these sells with the button is to delete cell data ready for next input without using Macros. The example code used by Excel is. 
 =Sheet!$J$16,Sheet!$C$20,Sheet!$I$20,Sheet!$B$27:$I$47

While this may be by current Libre design its one area of incompatibility that would be nice to fix as we are all safer without Macros enabled. ;>) 

Steps to Reproduce:
1.Create a new Named Range
2.In the Range or Formula expression field type: $sheet.$J$16,$sheet.$C$20
3.Click ok and add this Named Range to a button.


Actual Results:
The Range Errors as its is invalid as only one range can be entered.

Expected Results:
When Pressed the button should select (highlight) all the cells defined in the ranges.


Reproducible: Always


User Profile Reset: No

Additional Info:
When Pressed the button should select (highlight) all the cells defined in the ranges.
Comment 1 ash 2024-12-11 10:22:13 UTC
Sorry I just realized that I said create a button but in fact it is just a cell that contains a hyperlink not a button (buttons I think are limited to macros). 

Create the named range and assign it to a hyperlink in a cell.

eg Excel steps are.
Select multiple groups of cells in a sheet.

Give it a name using formula > define name functions.

(In Excel the Refers to: field when defining the name lists all the groups of cells select in the sheet separated by commas like below.)
ie =Sheet1!$A$5:$B$5,Sheet1!$C$7:$C$10,Sheet1!$D$4:$F$4

(Libre only lists the cells last clicked on in the sheet even though multiple are selected.)

Select another cell in the sheet to become a function to select the chosen cells.

Next add a hyperlink using Insert > hyperlink > Place in this document > defined Name above.

When the cell with the hyperlink is selected the groups of cells are highlighted giving the user the chance to delete the contents of the highlighted cell.

This is a quick and easy to selectively delete cells in a sheet ready for new data. 

I hope this explains better what I was doing with Excel I cannot do with Libre. Lib
Comment 2 BogdanB 2025-01-15 15:54:07 UTC
I don't think this is a bug:

"Select a cell or range of cells, then choose Sheet - Named Ranges and Expressions - Define. The Define Names dialog appears."

https://help.libreoffice.org/latest/en-US/text/scalc/guide/value_with_name.html?&DbPAR=CALC&System=UNIX

I thnik this is how Named ranges are suposed to work, with a cell, or a range of cells, not 2 or more.
Comment 3 ash 2025-01-23 06:10:34 UTC
Given that Excel came first and Libre is trying to be compatible with it, I would have thought Libre has the issue as it works fine in Excel.
Did you try it with Excel before making your comment? 
I guess not.
Comment 4 Gabor Kelemen (allotropia) 2025-01-24 12:41:35 UTC
Yes, if you try to select some non-neighboring cells and try to name them in the top left name box you get the "The selection needs to be rectangular in order to name it." info message.
The Define Name dialog just quietly does not allow this sort of selection.

*** This bug has been marked as a duplicate of bug 35296 ***