Skip i'r prif gynnwys

Sut i wneud enw tab dalen yn hafal i werth celloedd yn Excel?

Mewn rhai achosion, efallai y bydd angen i chi ailenwi taflen waith yn seiliedig ar werth cell penodedig. Yn yr erthygl hon, byddwn yn dangos i chi ddulliau o wneud enw tab dalen yn hafal i werth celloedd yn Excel.

Gwneud enw tab dalen yn hafal i werth y gell gyda chod VBA
Gwnewch enw tab dalen yn gyfartal â gwerth celloedd gyda Kutools ar gyfer Excel


Gwneud enw tab dalen yn hafal i werth y gell gyda chod VBA

Gyda'r cod VBA canlynol, gallwch wneud enw tab dalen yn hafal i werth celloedd yn awtomatig.

1. De-gliciwch y tab dalen yr ydych am wneud enw'r ddalen yn hafal i werth y gell, yna cliciwch Gweld y Cod o'r ddewislen clicio ar y dde. Gweler y screenshot:

2. Copïwch a gludwch y cod isod i mewn i'r ffenestr Cod, ac yna pwyswch Alt + Q allweddi ar yr un pryd i gau ffenestr Microsoft Visual Basic for Applications.

Cod VBA: Gwneud tab dalen yn hafal i werth y gell

Private Sub Worksheet_Change(ByVal Target As Range)
'Updated by Extendoffice 20230130
    On Error Resume Next
    If Not Intersect(Target, Range("A1")) Is Nothing Then
        ActiveSheet.Name = ActiveSheet.Range("A1")
    ElseIf Not Intersect(Target.Dependents, Range("A1")) Then
        ActiveSheet.Name = ActiveSheet.Range("A1")
    End If
End Sub

Nodyn: Yn y cod, A1 yw'r gell sy'n cynnwys y gwerth y mae angen i chi ei ddefnyddio fel enw'r ddalen. Gallwch ei newid yn ôl yr angen.

O hyn ymlaen, pan newidiodd y gwerth yng nghell A1, bydd enw'r tab dalen yn cael ei newid yn gyfartal hefyd.


Gwnewch enw tab dalen yn gyfartal â gwerth celloedd gyda Kutools ar gyfer Excel

Yn yr adran hon, rydym yn cyflwyno'r Ail-enwi Taflenni Gwaith Lluosog cyfleustodau Kutools ar gyfer Excel. Gyda'r cyfleustodau hwn, gallwch chi ailenwi taflenni gwaith â gwerth celloedd penodol yn Excel yn hawdd.

Cyn gwneud cais Kutools ar gyfer Excel, os gwelwch yn dda ei lawrlwytho a'i osod yn gyntaf.

1. Cliciwch Kutools Byd Gwaith > Taflen Waith > Ail-enwi Taflenni Gwaith Lluosog. Gweler y screenshot:

2. Yn y Ail-enwi Taflenni Gwaith Lluosog blwch deialog, mae angen i chi wneud fel a ganlyn.

1). Gwiriwch enwau'r daflen waith rydych chi am ei hailenwi yn y Taflenni gwaith blwch (gallwch ddewis un ddalen neu ddalennau lluosog).
2). Dewiswch Amnewid enw'r daflen wreiddiol blwch yn y Ail-enwi Dewisiadau adran hon.
3). Os ydych chi am ailenwi taflen waith neu daflenni gwaith lluosog sydd â gwerth penodol i'r gell, dewiswch y O ystod benodol opsiwn, a dewiswch yr ystod o gelloedd rydych chi am ailenwi'r taflenni yn seiliedig arnyn nhw.
4). Cliciwch y OK botwm. Gweler y screenshot:

Gallwch weld bod y taflenni gwaith a ddewiswyd yn cael eu hailenwi gan y gwerth amrediad penodedig ar unwaith fel y dangosir isod y llun.

Nodiadau:

1. Gallwch ddefnyddio'r Hidlo swyddogaeth i hidlo'r daflen waith sydd ei hangen yn hawdd os oes llawer o daflenni gwaith yn bodoli.
2. Os ydych chi am ailenwi nifer o daflenni gwaith sydd â gwerth celloedd penodol ym mhob dalen. Er enghraifft, bydd taflen1 yn hafal i werth ei chell A1, a bydd taflen2 hefyd yn hafal i werth ei chell A1. Dewiswch daflenni gwaith yn y Taflenni gwaith blwch, yna dewiswch y Ail-enwi taflenni gwaith gyda chell benodol opsiwn, a nodwch gell A1 yn y blwch.

3. Ni fydd enw'r ddalen yn cael ei newid yn awtomatig gyda'r newidiadau yng ngwerth y gell.

  Os ydych chi am gael treial am ddim (30 diwrnod) o'r cyfleustodau hwn, cliciwch i'w lawrlwytho, ac yna ewch i gymhwyso'r llawdriniaeth yn ôl y camau uchod.


Gwnewch enw tab dalen yn gyfartal â gwerth celloedd gyda Kutools ar gyfer Excel

Offer Cynhyrchiant Swyddfa Gorau

🤖 Kutools AI Aide: Chwyldro dadansoddi data yn seiliedig ar: Cyflawniad Deallus   |  Cynhyrchu Cod  |  Creu Fformiwlâu Personol  |  Dadansoddi Data a Chynhyrchu Siartiau  |  Invoke Swyddogaethau Kutools...
Nodweddion Poblogaidd: Darganfod, Amlygu neu Adnabod Dyblygiadau   |  Dileu Rhesi Gwag   |  Cyfuno Colofnau neu Gelloedd heb Colli Data   |   Rownd heb Fformiwla ...
Super-edrych: VLookup Meini Prawf Lluosog    VLookup Gwerth Lluosog  |   VLookup Ar Draws Taflenni Lluosog   |   Edrych Niwlog ....
Rhestr gwympo Uwch: Creu Rhestr Gollwng yn Gyflym   |  Rhestr Gollwng Dibynnol   |  Rhestr Gollwng Aml-ddewis ....
Rheolwr Colofn: Ychwanegu Nifer Penodol o Golofnau  |  Symud Colofnau  |  Toglo Statws Gwelededd Colofnau Cudd  |  Cymharwch Ystodau a Cholofnau ...
Nodweddion dan Sylw: Ffocws ar y Grid   |  Golwg Dylunio   |   Bar Fformiwla Mawr    Rheolwr Llyfr Gwaith a Thaflen   |  Llyfrgell Adnoddau (Testun Auto)   |  Dewiswr Dyddiad   |  Cyfuno Taflenni Gwaith   |  Amgryptio/Dadgryptio Celloedd    Anfon E-byst trwy Restr   |  Hidlo Super   |   Hidlo Arbennig (hidlo mewn print trwm/italig/strikethrough...) ...
15 Set Offer Gorau12 Testun offer (Ychwanegu Testun, Dileu Cymeriadau,...)   |   50 + Siart Mathau (Siart Gantt,...)   |   40+ Ymarferol Fformiwlâu (Cyfrifwch oedran yn seiliedig ar ben-blwydd,...)   |   19 mewnosod offer (Mewnosod Cod QR, Mewnosod Llun o'r Llwybr,...)   |   12 Trosi offer (Rhifau i Eiriau, Trosi arian cyfred,...)   |   7 Uno a Hollti offer (Rhesi Cyfuno Uwch, Celloedd Hollt,...)   |   ... a mwy

Supercharge Eich Sgiliau Excel gyda Kutools ar gyfer Excel, a Phrofiad Effeithlonrwydd Fel Erioed Erioed. Kutools ar gyfer Excel Yn Cynnig Dros 300 o Nodweddion Uwch i Hybu Cynhyrchiant ac Arbed Amser.  Cliciwch Yma i Gael Y Nodwedd Sydd Ei Angen Y Mwyaf...

Disgrifiad


Mae Office Tab yn dod â rhyngwyneb Tabbed i Office, ac yn Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
Comments (30)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Good
It was the same thing I was looking for. But now I have a question:
After these steps were done, I created several sheets, I locked the sheet, but when I lock the book and enter a value in the cell, the name of the sheet does not change. In other words, it only changes with the spreadsheet unlocked and I would like to keep the spreadsheet locked
This comment was minimized by the moderator on the site
Boas
Era mesmo isto que estava a procurar. Mas agora tenho uma questão:
Após esses passos feitos, criei várias sheet, bloqueei a folha, mas quando bloqueio o livro e digito um valor na célula, o nome da sheet não muda. Ou seja, só muda com a sheet desbloqueada e gostaria de manter a sheet bloqueada
This comment was minimized by the moderator on the site
bonjour,
que voulez-vous dire par appuyer autre autre+q dans le code vba après avoir collé.
J'ai simplement fermé la page après avoir collé et ça ne marche pas
merci
This comment was minimized by the moderator on the site
worked beautifully!
This comment was minimized by the moderator on the site
Hi Crystal,

When i paste in your code it comes back with error "user-defined type not defined"?

Thanks.
This comment was minimized by the moderator on the site
Hi Tom J,
Make sure these three options are checked in the References - VBAProject dialog box.
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/error.png
This comment was minimized by the moderator on the site
This worked perfectly for my first worksheet, but not for the second or third etc (I have up to about 20 worksheets that all need this function). Am I missing something?
This comment was minimized by the moderator on the site
Hi A Owen,
This code only works for one worksheet per time. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
What is the highest nr of worksheets, that can be changed names via Kutools Plus? because the excel letting me only 17 names to changes, and that's it
This comment was minimized by the moderator on the site
I'm using your exact code from the above for VBA code which works perfectly for what I need. However, I have a bunch of macros on a sheet called Job Template that gets copied and reused for every new job. I designed all my macros based on a new copied version called Job Template (2). Once the sheet name is changed to the new job name, the macros no longer work and have to manually do it. I would like to be able to use any of my Macro buttons at any point instead of only using them before I change the sheet name.

Is there a way for the VBA code to always refer to the sheet name before running the rest of the code functions?
This comment was minimized by the moderator on the site
How can I reference two cells. for example name and id number?
This comment was minimized by the moderator on the site
This is exactly what I need, but I need the tab to recreate a date and it isn't working... I assume this is something to do with the way excel works out date and time, can anyone suggest a workaround?
This comment was minimized by the moderator on the site
Hi Nick,
Excel does not support typing the sheet name containing special characters. If the date you type contains the character /, it won't allow you to create the sheet name with that date.
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