Loncat ke daftar isi utama

Bagaimana cara membuat nama tab sheet sama dengan nilai sel di Excel?

Dalam beberapa kasus, Anda mungkin perlu mengganti nama lembar kerja berdasarkan nilai sel yang ditentukan. Pada artikel ini, kami akan menunjukkan kepada Anda metode membuat nama tab sheet sama dengan nilai sel di Excel.

Buat nama tab sheet sama dengan nilai sel dengan kode VBA
Buat nama tab lembar sama dengan nilai sel dengan Kutools for Excel


Buat nama tab sheet sama dengan nilai sel dengan kode VBA

Dengan kode VBA berikut, Anda dapat membuat nama tab lembar sama dengan nilai sel secara otomatis.

1. Klik kanan tab sheet yang ingin Anda jadikan nama sheet sama dengan nilai sel, lalu klik Lihat kode dari menu klik kanan. Lihat tangkapan layar:

2. Salin dan tempel kode di bawah ini ke jendela Kode, lalu tekan lain + Q secara bersamaan untuk menutup jendela Microsoft Visual Basic for Applications.

Kode VBA: Jadikan tab lembar sama dengan nilai sel

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

Note: Dalam kode, A1 adalah sel yang berisi nilai yang perlu Anda gunakan sebagai nama sheet. Anda dapat mengubahnya sesuai kebutuhan.

Mulai sekarang, ketika nilai di sel A1 berubah, nama tab sheet juga akan berubah sama.


Buat nama tab lembar sama dengan nilai sel dengan Kutools for Excel

Di bagian ini, kami memperkenalkan Anda Ubah Nama Beberapa Lembar Kerja kegunaan Kutools untuk Excel. Dengan utilitas ini, Anda dapat dengan mudah mengganti nama lembar kerja dengan nilai sel tertentu di Excel.

Sebelum melamar Kutools untuk Excel, Mohon unduh dan instal terlebih dahulu.

1. klik Kutools Ditambah > Lembar Kerja > Ubah Nama Beberapa Lembar Kerja. Lihat tangkapan layar:

2. Dalam Ubah Nama Beberapa Lembar Kerja kotak dialog, Anda perlu melakukan hal berikut.

1). Periksa nama lembar kerja yang ingin Anda ganti namanya di Lembar kerja kotak (Anda dapat memilih satu lembar atau beberapa lembar).
2). Pilih Ganti nama lembar asli kotak di Ubah Nama Opsi bagian.
3). Jika Anda ingin mengubah nama lembar kerja atau beberapa lembar kerja dengan nilai sel tertentu, pilih Dari jarak tertentu opsi, dan pilih rentang sel yang ingin Anda ganti namanya berdasarkan pada lembar.
4). Klik OK tombol. Lihat tangkapan layar:

Anda dapat melihat lembar kerja yang dipilih diganti namanya dengan nilai kisaran yang ditentukan segera seperti gambar di bawah ini.

Catatan:

1. Anda bisa menggunakan Filter berfungsi untuk dengan mudah menyaring worksheet yang dibutuhkan jika ada banyak worksheet.
2. Jika Anda ingin mengganti nama beberapa lembar kerja dengan nilai sel tertentu di setiap lembar. Misalnya, sheet1 akan sama dengan nilai sel A1-nya, dan sheet2 juga akan sama dengan nilai sel A1-nya. Pilih lembar kerja di Lembar kerja kotak, lalu pilih Ubah nama lembar kerja dengan sel tertentu opsi, dan tentukan sel A1 di dalam kotak.

3. Nama sheet tidak akan berubah secara otomatis dengan perubahan nilai sel.

  Jika Anda ingin memiliki uji coba gratis (30 hari) dari utilitas ini, silahkan klik untuk mendownloadnya, lalu lanjutkan untuk menerapkan operasi sesuai langkah di atas.


Buat nama tab lembar sama dengan nilai sel dengan Kutools for Excel

Alat Produktivitas Kantor Terbaik

馃 Kutools AI Ajudan: Merevolusi analisis data berdasarkan: Eksekusi Cerdas   |  Hasilkan Kode  |  Buat Rumus Khusus  |  Analisis Data dan Hasilkan Grafik  |  Aktifkan Fungsi Kutools...
Fitur Populer: Temukan, Sorot, atau Identifikasi Duplikat   |  Hapus Baris Kosong   |  Gabungkan Kolom atau Sel tanpa Kehilangan Data   |   Putaran tanpa Formula ...
Pencarian Super: VLookup Beberapa Kriteria    VLookup Nilai Berganda  |   VLookup di Beberapa Lembar   |   Pencarian Fuzzy ....
Daftar Drop-down Lanjutan: Buat Daftar Drop Down dengan Cepat   |  Daftar Drop Down yang Bergantung   |  Multi-pilih Drop Down List ....
Manajer Kolom: Tambahkan Jumlah Kolom Tertentu  |  Pindahkan Kolom  |  Alihkan Status Visibilitas Kolom Tersembunyi  |  Bandingkan Rentang & Kolom ...
Fitur Unggulan: Fokus Kisi   |  Tampilan Desain   |   Bar Formula Besar    Manajer Buku Kerja & Lembar   |  Perpustakaan Sumberdaya (Teks otomatis)   |  Pemetik tanggal   |  Gabungkan Lembar Kerja   |  Enkripsi/Dekripsi Sel    Kirim Email berdasarkan Daftar   |  Filter Super   |   Filter Khusus (filter tebal/miring/coret...) ...
15 Perangkat Teratas12 Teks Tools (Tambahkan Teks, Hapus Karakter, ...)   |   50 + Grafik jenis (Gantt Chart, ...)   |   40+ Praktis Rumus (Hitung usia berdasarkan ulang tahun, ...)   |   19 Insersi Tools (Masukkan Kode QR, Sisipkan Gambar dari Jalur, ...)   |   12 Konversi Tools (Angka ke Kata, Konversi Mata Uang, ...)   |   7 Gabungkan & Pisahkan Tools (Lanjutan Gabungkan Baris, Pisahkan Sel, ...)   |   ... dan banyak lagi

Tingkatkan Keterampilan Excel Anda dengan Kutools for Excel, dan Rasakan Efisiensi yang Belum Pernah Ada Sebelumnya. Kutools for Excel Menawarkan Lebih dari 300 Fitur Lanjutan untuk Meningkatkan Produktivitas dan Menghemat Waktu.  Klik Di Sini untuk Mendapatkan Fitur yang Paling Anda Butuhkan...

Deskripsi Produk


Tab Office Membawa antarmuka Tab ke Office, dan Membuat Pekerjaan Anda Jauh Lebih Mudah

  • Aktifkan pengeditan dan pembacaan tab di Word, Excel, PowerPoint, Publisher, Access, Visio, dan Project.
  • Buka dan buat banyak dokumen di tab baru di jendela yang sama, bukan di jendela baru.
  • Meningkatkan produktivitas Anda sebesar 50%, dan mengurangi ratusan klik mouse untuk Anda setiap hari!
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