Skip to main content

Conas liosta d’ainmneacha na mbileog a fháil i mbileoga Google?

An t-alt seo, tabharfaidh mé roinnt modhanna isteach chun ainm ainm reatha na bileoige nó liosta ainmneacha bileoga a fháil i mbileoga Google.

Faigh ainm reatha na bileoige i mbileoga Goolge le script

Faigh liosta d’ainmneacha na mbileog i mbileoga Google le script


Faigh ainm reatha na bileoige i mbileoga Goolge le script

Chun ainm reatha na bileoige a fháil i mbileoga Google, is féidir leis an script shimplí seo a leanas cabhrú leat gan an t-ainm a iontráil de láimh, déan mar seo le do thoil:

1. Cliceáil uirlisí > Eagarthóir scripte, féach ar an scáileán:

faigh ainm bileog 1

2. I bhfuinneog an tionscadail a osclaíodh, cóipeáil agus greamaigh an cód script thíos sa bán cód fuinneog, féach an scáileán:

function sheetName() {
  return SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getName();
}

faigh ainm bileog 2

3. Ansin sábháil fuinneog an chóid, agus téigh ar ais chuig an mbileog a theastaíonn uait a hainm a fháil, ansin iontráil an fhoirmle seo: =sheetname() i gcill, agus brúigh Iontráil eochair, taispeánfar ainm na bileoige ag an am céanna, féach an scáileán:

faigh ainm bileog 3


Faigh liosta d’ainmneacha na mbileog i mbileoga Google le script

Más mian leat gach ainm bileog a fháil ar bhileoga Google, seo script eile ar féidir leat fabhar a dhéanamh duit, déan mar seo le do thoil:

1. Cliceáil uirlisí > Script eagarthóir le dul fuinneog an tionscadail, agus ansin an cód script thíos a chóipeáil agus a ghreamú isteach sa bán cód fuinneog, féach an scáileán:

function sheetnames() { 
  var out = new Array()
  var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
  for (var i=0 ; i<sheets.length ; i++) out.push( [ sheets[i].getName() ] )
  return out  
}

faigh ainm bileog 4

2. Ansin sábháil fuinneog an chóid, agus téigh ar ais chuig an mbileog a theastaíonn uait gach ainm bileog a fháil, ansin iontráil an fhoirmle seo: =sheetnames() i gcill, agus brúigh Iontráil eochair, liostálfar gach ainm bileog i mbileoga Google mar a leanas an pictiúr a thaispeántar:

faigh ainm bileog 5


Liostáil gach ainm bileog agus nascleanúint eatarthu trí hipearnasc nó cnaipí a úsáid i leabhar oibre Excel:

Le Kutools le haghaidh Excel's Cruthaigh Liosta Ainmneacha Bileog fóntais, is féidir leat gach ainm bileog oibre a liostáil go tapa i mbileog nua le hipearnasc nó macra-cnaipí, ansin is féidir leat nascleanúint a dhéanamh eatarthu de réir do riachtanas.

Kutools le haghaidh Excel: le níos mó ná 300 breiseán áisiúil Excel, saor in aisce le triail gan aon teorannú i 30 lá. Íoslódáil agus triail saor in aisce Anois!

Uirlisí Táirgiúlachta Oifige is Fearr

🤖 Kutools AI Aide: anailís sonraí a réabhlóidiú bunaithe ar: Forghníomhú Chliste   |  Gin Cód  |  Cruthaigh Foirmlí Saincheaptha  |  Anailís a dhéanamh ar Sonraí agus Cairteacha a Ghin  |  Feidhmeanna Kutools a agairt...
Gnéithe Coitianta: Faigh, Aibhsigh nó Aithnigh Dúblaigh   |  Scrios Sraitheanna Bána   |  Comhcheangail Colúin nó Cealla gan Sonraí a Chailleadh   |   Babhta gan Foirmle ...
Cuardaigh Super: Ilchritéir VLookup    VLookup Illuachanna  |   VLookup Trasna Ilbhileoga   |   Amharc doiléir ....
Liosta anuas Casta: Go tapa Cruthaigh Liosta Anuas   |  Liosta anuas Cleithiúnach   |  Liosta Buail Isteach Ilroghnacha ....
Bainisteoir Colún: Cuir Líon Sonrach Colún leis  |  Colúin Bog  |  Scoránaigh Stádas Infheictheachta na gColún Ceilte  |  Déan comparáid idir Raonta & Colúin ...
Gnéithe Réadmhaoin: Fócas Eangaí   |  Amharc Dearaidh   |   Barra Mór na Foirmle    Leabhar Oibre & Bainisteoir Bileog   |  Leabharlann Acmhainní (Uaththéacs)   |  Piocálaí Dáta   |  Comhcheangail Bileoga Oibre   |  Criptigh/Díchriptigh Cealla    Seol Ríomhphost trí Liosta   |  Scagaire Super   |   Scagaire Speisialta (scagaire trom/iodálach/stailc tríd...) ...
Barr 15 Uirlisí12 Téacs uirlisí (Cuir Téacs, Bain Carachtair,...)   |   50 + Cairt cineálacha (Cairt Gantt,...)   |   40+ Praiticiúil Foirmlí (Ríomh aois bunaithe ar lá breithe,...)   |   19 Insertion uirlisí (Cuir isteach Cód QR, Ionsáigh Pictiúr ón gCosán,...)   |   12 Tiontú uirlisí (Uimhreacha le Focail, Comhshó Airgeadra,...)   |   7 Cumaisc & Scoilt uirlisí (Sraitheanna Comhcheangail Casta, Cealla Scoilt,...)   |   ... agus eile

Supercharge Do Scileanna Excel le Kutools le haghaidh Excel, agus Éifeachtúlacht Taithí Cosúil Ná Roimhe. Kutools le haghaidh Excel Tairiscintí Níos mó ná 300 Ardghnéithe chun Táirgiúlacht a Treisiú agus Sábháil Am.  Cliceáil anseo chun an ghné is mó a theastaíonn uait a fháil ...

Tuairisc


Tugann Tab Oifige comhéadan Tabbed chuig Office, agus Déan Do Obair i bhfad Níos Éasca

  • Cumasaigh eagarthóireacht agus léamh tabbed i Word, Excel, PowerPoint, Foilsitheoir, Rochtain, Visio agus Tionscadal.
  • Oscail agus cruthaigh cáipéisí iolracha i gcluaisíní nua den fhuinneog chéanna, seachas i bhfuinneoga nua.
  • Méadaíonn do tháirgiúlacht 50%, agus laghdaíonn sé na céadta cad a tharlaíonn nuair luch duit gach lá!
Comments (21)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thanks :)))
This comment was minimized by the moderator on the site
This script in Google Sheets works great! However, sheetnames() doesn't seem to update when new sheets are added or sheets are renamed. Is there a way to make it refresh?
This comment was minimized by the moderator on the site
why is it not working for me?i have copied the scripts and they seem so run with no errors, but when i go to google sheets, it dosent show the function "sheetsname"
This comment was minimized by the moderator on the site
Save the script and run
This comment was minimized by the moderator on the site
How to export all sheet names in open excel file to Google Sheet? Thank you
This comment was minimized by the moderator on the site
How to export all sheet names in open excel file to Google Sheet?
This comment was minimized by the moderator on the site
works for me! Thanks!!!
This comment was minimized by the moderator on the site
TypeError: Cannot read property 'getSheets' of null (riadok 3, súbor Kód)
This comment was minimized by the moderator on the site
Sorry.I did something wrong.It is already working fine.
This comment was minimized by the moderator on the site
Hey, may i know what is your mistake? i have the same error
This comment was minimized by the moderator on the site
Hi.
Of course You can.
I created a script using the Google Script Manager (script.google.com) and thought it would work automatically on all sheets in my google drive, but that wasn't true.Probably a script created throught Google Script Manager, not throught sheet, is not linked to a sheet.I had to create a script via menu in the top bar in the open Google Sheets "Tools / Script Editor" and the function I created works only in that given sheet.Please write if this solved your problem.
:)
This comment was minimized by the moderator on the site
Hello,


Ive registered an account just to say, ive found a way to automatically update this function, its a cheat really.



In cell C!, ive put a checkbox.

At my header of sheet names, I put this code.



=if(C1=true,sheetnames(),)


Then, when we edit a tab name or create a new one, we uncheck the box and check it again and it is done, not perfect, but better than deleting the cell and re-pasting.


Thank you


Charlie.

EDIT , i tried inserting picture, but it seems to disappear.
This comment was minimized by the moderator on the site
For everyone wondering how to get the sheet index to update automatically, you need to be able to call the function and then Re-enter the formula into where you want the index to be kept.
In my case I have a dedicated Index Sheet, and after most of my functions I call 'sheetnames()' and then just Re-enter the formula in the specific cell.
This comment was minimized by the moderator on the site
sheetnames();
ss.getSheetByName('Index').getRange('A1').setFormula('=sheetnames()');
This comment was minimized by the moderator on the site
What's ss?
This comment was minimized by the moderator on the site
Hi Carlos,

var ss = SpreadsheetApp.getActive();

Hope that helps.
This comment was minimized by the moderator on the site
me pueden ayudar para crear una macro en GAS que abra una nueva hoja (sheet), luego la renombre y luego se puede escribir dentro de esta hoja nueva?
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations