Loncat ke daftar isi utama

Bagaimana cara memasukkan tanggal modifikasi terakhir di header atau footer Excel?

Di Excel, kita dapat dengan cepat dan mudah memasukkan informasi buku kerja, seperti nama file, path lengkap file, tanggal sekarang dan sebagainya ke dalam header atau footer. Tetapi apakah Anda pernah mencoba memasukkan tanggal dan waktu terakhir dari lembar kerja ke dalamnya? Excel tidak menyediakan fitur ini bagi kami untuk memasukkan tanggal modifikasi terakhir di header atau footer, dan di sini, saya akan memperkenalkan Anda cara praktis untuk mengatasinya.

Masukkan tanggal modifikasi terakhir di header atau footer Excel dengan kode VBA

Masukkan tanggal terakhir diubah / tanggal dibuat / uske header / footer dengan Kutools for Excel ide bagus3


panah gelembung kanan biru Masukkan tanggal modifikasi terakhir di header atau footer Excel dengan kode VBA

Kode VBA sederhana berikut dapat membantu Anda memasukkan tanggal dan waktu terakhir yang disimpan dari lembar kerja ke header atau footer, lakukan seperti ini:

1. Aktifkan lembar kerja Anda yang ingin Anda sisipkan tanggal modifikasi terakhir ke header atau footer.

2. Kemudian tahan ALT + F11 kunci untuk membuka Jendela Microsoft Visual Basic for Applications.

3. Di kiri Proyek VBA panel, klik dua kali Buku Kerja Ini untuk membuka Modul, lalu salin dan tempel kode berikut.

Kode VBA: Masukkan tanggal modifikasi terakhir di header atau footer

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ActiveSheet.PageSetup.CenterHeader = "Last saved: " & Format(Date, "mm-dd-yy") & " " & Time
End Sub

doc-insert-last-stored-date-to-header-1

4. Kemudian simpan dan tutup kode ini, dan klik View > Page Layout untuk melihat hasilnya. Dan Anda dapat melihat tanggal dan waktu yang terakhir diubah telah dimasukkan ke dalam tajuk tengah. Lihat tangkapan layar:

doc-insert-last-stored-date-to-header-2
-1
doc-insert-last-stored-date-to-header-3

Catatan:

1. Tanggal dan waktu terakhir diubah diperbarui secara otomatis, saat Anda mengubah dan menyimpan file Excel.

2. Jika Anda perlu memasukkan tanggal dan waktu terakhir yang disimpan ini ke dalam header / footer kiri, header / footer kanan atau footer tengah, Anda hanya perlu mengubah CenterHeader pada kode di atas sesuai permintaan Anda.


panah gelembung kanan biru Masukkan tanggal terakhir diubah / tanggal dibuat / uske header / footer dengan Kutools for Excel

Dengan Kutools for Excel, Anda dapat menggunakan alat Sisipkan Informasi Buku Kerja untuk memasukkan informasi buku kerja dengan cepat ke header, footer, atau sel.

Kutools untuk Excel, dengan lebih dari 300 fungsi praktis, membuat pekerjaan Anda lebih mudah. 

Setelah menginstal Kutools for Excel, lakukan seperti di bawah ini :(Unduh Gratis Kutools untuk Excel Sekarang!)

Klik Kutools Ditambah > Buku catatan >Masukkan Informasi Buku Kerja, dan di dialog popping, periksa informasi yang ingin Anda sisipkan, dan pergi ke Sisipkan di bagian, periksa Jarak, Header or Footer opsi, dan tentukan untuk menyisipkan di header / footer kiri, header / footer tengah atau header / footer kanan untuk memenuhi kebutuhan Anda.
doc memasukkan informasi buku kerja
doc memasukkan informasi buku kerja

panah gelembung kanan biru Masukkan Informasi Buku Kerja


Artikel terkait:

Dapatkan dan masukkan waktu yang dibuat dan waktu modifikasi terakhir dalam sel

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 (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Why do I have to load the VB code into 'ThisWorkBook' of the VBAproject for every new workbook created? I would think that if I loaded the VB code into 'ThisWorkBook' of VBAHOME (PERSONAL.XLSB) if would be retained and available cresting new workbooks
This comment was minimized by the moderator on the site
Just tried it after moving the center header to the left footer. Didn't work. What I saved at 1:20 pm still recorded as 1:00 pm. Your help would be most appreciated. BTW, my spreadsheet was created as Excel 2007, and I made changes at the library on Excel 2016. Generally, I can go back and forth between versions with no problems.
Also, I didn't realize my name would be published. Any chance of changing it to Nancy E.?
Many thanks!
This comment was minimized by the moderator on the site
THANK YOU! That was invaluable. Who'd believe that Microsoft would exclude such an important function! What about Word? Is it done the same way now?
This comment was minimized by the moderator on the site
Thanks for the Info.
This comment was minimized by the moderator on the site
perfect.very useful ;-)
This comment was minimized by the moderator on the site
I did this and it works. I saved the file as .xlsx and closed it. Now, when I open it, I open the VBA coding window but I am not able to find this chunk of code to edit it. I would like to play with location and remove time. Thank you.
This comment was minimized by the moderator on the site
@John R. When you get to the VBA coding window, on the left section of the screen you need to double-click "ThisWorkbook" to open the right section of the screen. Then in the right section (at the top) you need to select "Workbook" and "BeforeSave". That should hopefully show you the chunk of code that you're looking for.
This comment was minimized by the moderator on the site
I tried this technique but could only get it to show up on one sheet. Help?
This comment was minimized by the moderator on the site
Thanks! I maintain an employee phone number and extension list. People get hired, quit, move to different extensions. If someone wants a copy I print it off, but it only showed the date and time it was printed -- not necessarily the most current information. It was difficult to tell if you had two different copies which one was the most up-to-date. Showing the last time the file was saved will do what I wanted!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations