[Solved] How to get list of sheet names into a sheet
[Solved] How to get list of sheet names into a sheet
Hello,
How do I get a list of sheet names of a spreadsheet file into cells. I want to make a contents sheet with hyperlinks to the sheets.I have seen earlier thread on how to rename sheets 1-100. This has a macro that I am trying to figure. And anyway the security warnings that come macros makes me uncomfortanle,leave alone say my boss. Is there any simpler way using inbuilt functions such as Sheet() and Sheets() etc,? Thanks.
An aside to our moderator is that I have just started compiling a list of mind bogglingly brilliant solutions I have found in this forum. I rate the spreadsheet same as the lever - you can shift paradigms!
thanks
How do I get a list of sheet names of a spreadsheet file into cells. I want to make a contents sheet with hyperlinks to the sheets.I have seen earlier thread on how to rename sheets 1-100. This has a macro that I am trying to figure. And anyway the security warnings that come macros makes me uncomfortanle,leave alone say my boss. Is there any simpler way using inbuilt functions such as Sheet() and Sheets() etc,? Thanks.
An aside to our moderator is that I have just started compiling a list of mind bogglingly brilliant solutions I have found in this forum. I rate the spreadsheet same as the lever - you can shift paradigms!
thanks
Last edited by Hagar Delest on Sat Jul 07, 2012 3:27 pm, edited 1 time in total.
Reason: tagged solved.
Reason: tagged solved.
OpenOffice 3.4 on Windows XP
Re: How to get list of sheet names into a sheet
hello,
what I have done is manually entered = in a cell and point to A1 of every sheet. Calc included the sheet name alright, eg.=Contents_2_2.A1 and dynamically updates any changes to file name. I copied the column to another place and Find and Replaced = and A1 with null to get sheet name list.
Now the problem 1) is to use =hyperlink() to open the sheet 2) automatically reference A1 in different sheets
what I have done is manually entered = in a cell and point to A1 of every sheet. Calc included the sheet name alright, eg.=Contents_2_2.A1 and dynamically updates any changes to file name. I copied the column to another place and Find and Replaced = and A1 with null to get sheet name list.
Now the problem 1) is to use =hyperlink() to open the sheet 2) automatically reference A1 in different sheets
OpenOffice 3.4 on Windows XP
Re: How to get list of sheet names into a sheet
Hallo
Some lines of code to set hyperlink-formulas to all sheets in doc starting at current selected cell:
Attention ! Python !
Karo
Some lines of code to set hyperlink-formulas to all sheets in doc starting at current selected cell:
Attention ! Python !
Code: Select all
def hyperlink_sheets():
doc = XSCRIPTCONTEXT.getDocument()
sel = doc.getCurrentSelection()
scol = sel.RangeAddress.StartColumn
srow = sel.RangeAddress.StartRow
sheet = sel.getSpreadsheet()
f = '''=HYPERLINK("#{0}";"{0}")'''.format
out = [ ( f(sheetname),) for sheetname in doc.Sheets.getElementNames()]
outrange = sheet.getCellRangeByPosition(
scol, srow, scol, srow + len(out)-1 )
outrange.setFormulaArray( tuple(out))
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
Re: How to get list of sheet names into a sheet
F5Now the problem 1) is to use =hyperlink() to open the sheet 2) automatically reference A1 in different sheets
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: How to get list of sheet names into a sheet
Good Day,
Thanks. Speechless. F5 The navigator was staring at me all the time (why aren't you using features here)! I have dragged sheet name with Drag Mode set to hyperlinks.
I searched Calc Tutorial for "Navigator", it has one example. I am looking for detailed documentation on features of Navigator with examples.
Thanks
Thanks. Speechless. F5 The navigator was staring at me all the time (why aren't you using features here)! I have dragged sheet name with Drag Mode set to hyperlinks.
I searched Calc Tutorial for "Navigator", it has one example. I am looking for detailed documentation on features of Navigator with examples.
Thanks
OpenOffice 3.4 on Windows XP
Re: [Solved] How to get list of sheet names into a sheet
You can use the navigator to copy references as hyperlinks and you can use it instead of hyperlinks.
There is a button to show only the selected category.
You can dock and undock the window (Ctrl+double-click grey unused area).
You can hide and unhide the docked window (click handle on the inner border) and you can temporarily unhide the docked window (click anywhere else on the inner border).
That's all, I think.
There is a button to show only the selected category.
You can dock and undock the window (Ctrl+double-click grey unused area).
You can hide and unhide the docked window (click handle on the inner border) and you can temporarily unhide the docked window (click anywhere else on the inner border).
That's all, I think.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: [Solved] How to get list of sheet names into a sheet
hello,
I would like to add that hyperlinks made this way can be copied to any drawn shape, such as circle, oval etc. to get rid of the usually found annoying grey background! And the font color can be changed to any desired color.
thanks
I would like to add that hyperlinks made this way can be copied to any drawn shape, such as circle, oval etc. to get rid of the usually found annoying grey background! And the font color can be changed to any desired color.
thanks
OpenOffice 3.4 on Windows XP
Re: [Solved] How to get list of sheet names into a sheet
Nonsense !sukhdev wrote: I would like to add that hyperlinks made this way can be copied to any drawn shape, such as circle, oval etc. to get rid of the usually found annoying grey background! And the font color can be changed to any desired color.
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
Re: [Solved] How to get list of sheet names into a sheet
A calculator is not a web-page editor.
Anyway: http://user.services.openoffice.org/en/ ... php?id=716
Anyway: http://user.services.openoffice.org/en/ ... php?id=716
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
- kingfisher
- Volunteer
- Posts: 2123
- Joined: Tue Nov 20, 2007 10:53 am
Re: [Solved] How to get list of sheet names into a sheet
To get rid of the "annoying grey background" use the menu selection Tools > Options > Appearance. Scroll down the panel labelled "Custom colours" until you get to the heading "Text Document" and remove the tick alongside "Field shadings." From memory, that will also result in "field shadings" not showing in Writer. Alternatively, change the colour to one that suits you in both applications.
Apache OpenOffice 4.1.9 on Linux
-
- Posts: 8
- Joined: Wed Jan 28, 2015 4:58 pm
Re: [Solved] How to get list of sheet names into a sheet
This is exactly what I'm trying to find out but did not actually see the answer, although it says "solved." Can someone tell me how to get a list of sheet names into a sheet. I'm trying to write a summary sheet. Thanks.
OpenOffice 4.0.0 on Windows 7
Re: [Solved] How to get list of sheet names into a sheet
Welcome to the community forum!
You will need some macro code to get a literal list of sheet names. Here's the simplest workaround:
Open your document and view the summary sheet.
Open the Navigator window (View > Navigator: YES, or F5)
Expand the "Sheets" category; all sheet names should appear under "Sheets"
Click on any sheet name and drag it onto the cell grid. When you release the mouse button, a hyperlink is created pointing to the dragged sheet name.
Repeat for any other sheets you want to link to.
Of course you can also use the Navigator directly: double-click on any sheet name to switch.
You will need some macro code to get a literal list of sheet names. Here's the simplest workaround:
Open your document and view the summary sheet.
Open the Navigator window (View > Navigator: YES, or F5)
Expand the "Sheets" category; all sheet names should appear under "Sheets"
Click on any sheet name and drag it onto the cell grid. When you release the mouse button, a hyperlink is created pointing to the dragged sheet name.
Repeat for any other sheets you want to link to.
Of course you can also use the Navigator directly: double-click on any sheet name to switch.
AOO4/LO5 • Linux • Fedora 23
-
- Posts: 8
- Joined: Wed Jan 28, 2015 4:58 pm
Re: [Solved] How to get list of sheet names into a sheet
OK, we're getting warmer, but we're not there yet. What I ultimately am trying to accomplish is this. I have 12 spreadsheets, one for each month of the year. Each month has approximately 72 tabs, each tab representing a charge customer. Each customer has multiple columns, each column a sales category. At the top of these columns is a total. In my summary page, I would like to have a list of customers (sheet tabs) on the left with a total of each of the columns (sales categories) progressing left to right. Customers come and go, so each month ends up having slightly different sheet tabs.
If I had a quick way to list the customers, I could at least go back, insert an = sign before the customer name, reference the cell with the column total and then drag off to the right to copy the remaining column totals (ie =JimJones.B5).
As it stands now, I need to go to the summary page, type the customer names in the left column and then go back and add the = sign and cell reference.
If I had a quick way to list the customers, I could at least go back, insert an = sign before the customer name, reference the cell with the column total and then drag off to the right to copy the remaining column totals (ie =JimJones.B5).
As it stands now, I need to go to the summary page, type the customer names in the left column and then go back and add the = sign and cell reference.
OpenOffice 4.0.0 on Windows 7
Re: [Solved] How to get list of sheet names into a sheet
You should learn how to query information from well organized data sets where related data are not split across multiple sheets.kurtrabbit wrote:As it stands now, I need to go to the summary page, type the customer names in the left column and then go back and add the = sign and cell reference.
On topic "How to get list of sheet names into a sheet":
Code: Select all
Function SHEETNAMES()
SHEETNAMES = ThisComponent.Sheets.getElementNames()
End Function
The array formula =TRANSPOSE(SHEETNAMES()) [Ctrl+Shift+Enter] inserts a vertical list of sheet names.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 8
- Joined: Wed Jan 28, 2015 4:58 pm
Re: [Solved] How to get list of sheet names into a sheet
Villeroy, thank you for your reply. I have no idea what this means, "You should learn how to query information from well organized data sets where related data are not split across multiple sheets."
Also, I think this will help, "The array formula =TRANSPOSE(SHEETNAMES()) [Ctrl+Shift+Enter] inserts a vertical list of sheet names." but I have no idea what to do with the information. Inserting a list of sheet names would be very helpful but again, how do I actually do it, step-by-step?
Also, I think this will help, "The array formula =TRANSPOSE(SHEETNAMES()) [Ctrl+Shift+Enter] inserts a vertical list of sheet names." but I have no idea what to do with the information. Inserting a list of sheet names would be very helpful but again, how do I actually do it, step-by-step?
OpenOffice 4.0.0 on Windows 7
Re: [Solved] How to get list of sheet names into a sheet
If you want to avoid complications with an arrayformula (total number of sheets may change ...) you can try:
Starting with =SHEETNAME(ROW(K11)-ROW(K$11)+1) in K11, e.g. and filling this formula down as far as needed, you will get your sheets survey in a column ... You may also display a subset, of course.
Keep in mind that relying on custom programming will always bring disadvantages, too.
Code: Select all
Function SheetName(Optional pNo As Long)
'This function will assume the sheets numbered starting from 1.
'Used in the first sheet of a document it may terminate 'without returning a result
'if it was called during opening the document from file.
'Note: A cell will NOT RECALCULATE DUE TO A CHANGE OF THE SheetName.
'It's the same with insertion or deletion of sheets.
'You will have to FORCE RECALCULATION "on any event".
'This can be done by appending "+NOW()*0" to the parameter expression, e.g.
Dim oDoc As Object
Dim oSheet As Object
Dim nSheets As Long
If IsMissing(pNo) Then SheetName = ".Parameter.Missing." : GoTo EmergencyExit
On Error GoTo EmergencyExit:
oDoc = ThisComponent
nSheets = oDoc.Sheets.Count()
IF (pNo > 0) AND (pNo <= nSheets) THEN
oSheet = oDoc.Sheets(pNo-1)
SheetName = oSheet.GetName()
ELSE
SheetName = ".No.Result."
EndIf
EmergencyExit:
End Function 'SheetName
Keep in mind that relying on custom programming will always bring disadvantages, too.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München