Ana içeriğe atla

Excel'de satırları veya sütunları gizlemek / göstermek için onay kutusu nasıl kullanılır?

Belirli satırları veya sütunları gizlemek veya göstermek için bir onay kutusu kullanmanız gerektiğini varsayarsak. Örneğin, Active X Control onay kutusu işaretlendiğinde, belirli satırlar veya sütunlar görüntülenir, aksi takdirde gizlenirler. Bu makale, Excel'deki satırları veya sütunları ayrıntılarla gizlemek / göstermek için onay kutusunu nasıl kullanacağınızı gösterir.

VBA kodu ile satırları veya sütunları gizlemek / göstermek için onay kutusunu kullanın


VBA kodu ile satırları veya sütunları gizlemek / göstermek için onay kutusunu kullanın

Aşağıdaki VBA kodu, onay kutusu ile belirli satırları veya sütunları gizlemenize / göstermenize yardımcı olabilir.

1. Çalışma sayfasına bir Active X Control onay kutusu ekledikten sonra, onay kutusuna sağ tıklayın ve ardından Kodu Görüntüle sağ tıklama menüsünden. Ekran görüntüsüne bakın:

2. içinde Uygulamalar için Microsoft Visual Basic penceresinde, aşağıdaki VBA kodunu Kod penceresine kopyalayıp yapıştırın.

VBA kodu: Satırları veya sütunları gizlemek / göstermek için onay kutusunu kullanın

Private Sub CheckBox1_Click()
    [C:D].EntireColumn.Hidden = Not CheckBox1
End Sub

notlar:

1. VBA kodunda, [CD]. EntireColumn C ve D sütunlarının ilgili onay kutusu işaretlenerek veya işaretini kaldırarak gizleneceği veya gösterileceği anlamına gelir.

2. Satır 6: 9 gibi belirli satırları gizlemek veya görüntülemek için lütfen [CD]. EntireColumn için [6: 9]. Tüm satır VBA kodunda.

3. Tuşuna basın. Ara Toplam + Q kapatmak için aynı anda tuşları Uygulamalar için Microsoft Visual Basic pencere.

4. Şimdi lütfen kapatın Tasarım Modu altında Geliştirici aşağıda gösterilen ekran görüntüsü gibi sekme:

Şu andan itibaren, onay kutusu işaretlendiğinde, belirtilen satırlar veya sütunlar görüntülenir. İşaretli olmadığında, belirtilen satırlar veya sütunlar gizlenir.


İlgili yazılar:

En İyi Ofis Üretkenlik Araçları

🤖 Kutools AI Yardımcısı: Aşağıdakilere dayalı olarak veri analizinde devrim yaratın: Akıllı Yürütme   |  Kodunu oluşturun  |  Özel Formüller Oluşturun  |  Verileri Analiz Edin ve Grafikler Oluşturun  |  Kutools İşlevlerini Çağır...
Popüler Özellikler: Yinelenenleri Bul, Vurgula veya Tanımla   |  Boş Satırları Sil   |  Veri Kaybı Olmadan Sütunları veya Hücreleri Birleştirin   |   Formülsüz Tur ...
Süper Arama: Çoklu Ölçütlü VLookup    Çoklu Değer VLookup  |   Birden Çok Sayfada VLookup   |   Bulanık Arama ....
Gelişmiş Açılır Liste: Hızla Açılır Liste Oluşturun   |  Bağımlı Açılır Liste   |  Çoklu Seçim Açılır Liste ....
Sütun Yöneticisi: Belirli Sayıda Sütun Ekleme  |  Sütunları Taşı  |  Gizli Sütunların Görünürlük Durumunu Değiştir  |  Aralıkları ve Sütunları Karşılaştırın ...
Öne Çıkan Özellikler: Izgara Odağı   |  Tasarım görünümü   |   Büyük Formül Çubuğu    Çalışma Kitabı ve Sayfa Yöneticisi   |  Kaynak Kütüphanesi (Otomatik metin)   |  Tarih Seçici   |  Çalışma Sayfalarını Birleştirin   |  Hücreleri Şifrele/Şifresini Çöz    E-postaları Listeye Göre Gönder   |  Süper Filtre   |   Özel Filtre (kalın/italik/üstü çizili filtre...) ...
En İyi 15 Araç Seti12 Metin Tools (Metin ekle, Karakterleri Kaldır, ...)   |   50+ Grafik Türleri (Gantt şeması, ...)   |   40+ Pratik Formüller (Yaşı doğum gününe göre hesapla, ...)   |   19 sokma Tools (QR Kodunu Girin, Yoldan Resim Ekle, ...)   |   12 Dönüştürme Tools (Sayılardan Kelimelere, Para Birimi Dönüştürme, ...)   |   7 Birleştir ve Böl Tools (Gelişmiş Kombine Satırları, Bölünmüş hücreler, ...)   |   ... ve dahası

Kutools for Excel ile Excel Becerilerinizi Güçlendirin ve Daha Önce Hiç Olmadığı Gibi Verimliliği Deneyimleyin. Kutools for Excel, Üretkenliği Artırmak ve Zamandan Tasarruf Etmek için 300'den Fazla Gelişmiş Özellik Sunar.  En Çok İhtiyacınız Olan Özelliği Almak İçin Buraya Tıklayın...

Açıklama


Office Tab, Office'e Sekmeli Arayüz Getirir ve İşinizi Çok Daha Kolay Hale Getirir

  • Word, Excel, PowerPoint'te sekmeli düzenlemeyi ve okumayı etkinleştirin, Publisher, Access, Visio ve Project.
  • Yeni pencereler yerine aynı pencerenin yeni sekmelerinde birden çok belge açın ve oluşturun.
  • Üretkenliğinizi% 50 artırır ve her gün sizin için yüzlerce fare tıklamasını azaltır!
Comments (26)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Bei mir werden die Zellen nicht ausgeblendet, wenn das Kontrollkästchen wieder in aktiv ist.

Mein Ziel ist es mit dem aktiveren des Kontrollkästchen die Zeile 7 einzublenden und wenn ich den Haken wieder entferne sollte Zeile 47 wieder ausgeblendet sein.
Hilfe....
This comment was minimized by the moderator on the site
Hi Rose,
The following VBA code can help.
Private Sub CheckBox1_Click()
[47:47].EntireRow.Hidden = Not CheckBox1
End Sub
This comment was minimized by the moderator on the site
E para ocultar colunas não sequências?
Exemplo: A e C

Esta situação seria aplicado de que forma para A e C ?

"Sub CheckBox1_Click privada ()
[C:D].EntireColumn.Hidden = Não CheckBox1
End Sub"
This comment was minimized by the moderator on the site
Hi,
The following VBA code can do you a favor. Please give it a try.
Private Sub CheckBox1_Click()
'Updated by Extendoffice 20220810
    [C:C, A:A].EntireColumn.Hidden = Not CheckBox1
End Sub
This comment was minimized by the moderator on the site
Bom dia!
Espero que todos estejam bem!

Tenho uma situação onde preciso ocultar / reexibir a coluna utilizando o Control ActiveX quando solecionado o item.

Exemplo: Tenho coluna com os nomes: Planejado, Realizado, Análise Vertical, Análise Vertical, Variação (R$) e Variação (%), no entanto, que poder selecionar individual as colunas intercalando se necessário. Selecionar somente a coluna Realizado e Variação, mesmo não estando na sequencia.

Desde já agradeço,
Welington
This comment was minimized by the moderator on the site
Hi,
Sorry I don't understand what you mean. Would you mind providing a screenshot of your data?
You may need to attach a screenshot or a sample file to describe the problem you encountered more clearly.
This comment was minimized by the moderator on the site
Esse código oculta, mas não executa a reexibição quando desmarcar.

Alguém pode complementar por favor? Preciso de um código para ocultar e reexibir colunas indicadas.

Private Sub CheckBox1_Click()
[C:D].EntireColumn.Hidden = Not CheckBox1
End Sub

Obrigado
This comment was minimized by the moderator on the site
Hi Welington Mesquita,
This VBA code can acheive:
When the checkbox1 is checked, the column C:D are displayed;
When it is unchecked, the column C:D are hidden.
The code works well in my case. Which Excel version are you using?
This comment was minimized by the moderator on the site
What if i wanted to use 3 different checkboxes and wanted them to each toggle hiding different groups of rows? I have tried and looked all over. When I try to modify this code the checkboxes seem to interfere with each other.
This comment was minimized by the moderator on the site
What if i wanted to use 3 different checkboxes and wanted them to each toggle hiding different groups of rows? I have tried and looked all over. When I try to modify this code the checkboxes seem to interfere with each other.
This comment was minimized by the moderator on the site
Very useful, but how can I use it to hide just a part of the spreadsheet? I mean for example cells B2:B11, how to combine those two functions? Thanks.
This comment was minimized by the moderator on the site
It worked, but then when I saved the file, and reopen it doesn't work. I tried saving it as a Macro excel sheet and as a regular workbook. What have I done wrong? I want to give it to someone else to use and don't want them to be confused.
This comment was minimized by the moderator on the site
Hi angela,After adding the code into workbook, please click File > Save as, choose where to save the file, in the Save As dialog box, choose Excel Macro-Enabled Workbook (*.xlsm) from the Save as type drop-down, and finally click Save. Then send this Excel Macro-Enabled workbook to others.
This comment was minimized by the moderator on the site
I was try to unhide the first three role but it was not work.How can I do it ,I know it the person who send me that file wanna know my skill I can solve it or not.
This comment was minimized by the moderator on the site
Hi May,
Sorry I didn't get your point.
This comment was minimized by the moderator on the site
Hello,

Is there a way to hide only one row. If I put 6:9 all rows are hidden, but if I only put 6, it comes out as error. Would appreciate your help, thank you!
This comment was minimized by the moderator on the site
Hi,
Please change the second line in the code to:
[6:6].EntireRow.Hidden = Not CheckBox1.
Thank you for your comment.
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