انتقل إلى المحتوى الرئيسي

كيفية استخدام الزر لإظهار إخفاء الأعمدة في Excel؟

ستوضح لك هذه المقالة طرق إنشاء واستخدام الزر لإظهار وإخفاء الأعمدة في Excel.

استخدم الزر لإظهار إخفاء الأعمدة باستخدام الزر "تبديل"
استخدم الزر لإظهار إخفاء الأعمدة باستخدام Kutools for Excel


استخدم الزر لإظهار إخفاء الأعمدة باستخدام الزر "تبديل"

يمكنك إنشاء زر Toggle لإظهار إخفاء الأعمدة بالنقر فوقه. الرجاء القيام بما يلي.

1. انقر المطور > إدراج > زر التبديل (عنصر تحكم ActiveX). انظر لقطة الشاشة:

ملاحظات: إذا كنت لا ترى ملف المطور علامة التبويب على الشريط ، الرجاء النقر فوق إظهار / عرض علامة تبويب المطور في Excel لمعرفة كيفية تمكينها.

2. ارسم زر تبديل في ورقة العمل. انقر بزر الماوس الأيمن فوقه ، ثم حدد عرض الرمز من قائمة النقر بزر الماوس الأيمن. انظر لقطة الشاشة:

3. في فتح تطبيقات Microsoft Visual Basic نافذة ، استبدل كل المحتوى في نافذة التعليمات البرمجية بكود VBA أدناه.

كود فبا: زر لإظهار إخفاء الأعمدة

Private Sub ToggleButton1_Click()
Dim xAddress As String
xAddress = "F:G"
If ToggleButton1.Value Then
    Application.ActiveSheet.Columns(xAddress).Hidden = True
Else
    Application.ActiveSheet.Columns(xAddress).Hidden = False
End If
End Sub

ملاحظات: "F: G" في الكود يعني أن الأعمدة F: G سيتم إظهارها وإخفائها أثناء تشغيل الكود. الرجاء تغييرها لاحتياجاتك.

4. صحافة قديم + Q مفاتيح في نفس الوقت لإغلاق تطبيقات Microsoft Visual Basic نافذة.

5. إيقاف تشغيل وضع التصميم مع النقر المطور > وضع التصميم.

الآن عند النقر فوق زر التبديل ، يتم إخفاء الأعمدة المحددة على الفور.

أثناء النقر فوقه مرة أخرى ، يتم عرض الأعمدة.


استخدم الزر لإظهار إخفاء الأعمدة باستخدام Kutools for Excel

إذا كانت هناك بالفعل أعمدة مخفية في ورقة العمل الخاصة بك ، كوتولس ل إكسيلالصورة تبديل لإظهار / إخفاء كل الأعمدة المخفية يمكن أن تساعدك الأداة على إظهارها وإخفائها بسرعة بنقرة واحدة فقط.

قبل التطبيق كوتولس ل إكسيلالرجاء قم بتنزيله وتثبيته أولاً.

1. انقر كوتولس > التنقل.

2. التحول إلى قائمة الأعمدة الجزء ، ثم يمكنك النقر فوق ملف تبديل لإظهار / إخفاء كل الأعمدة المخفية زر لإظهار / إخفاء الأعمدة في ورقة العمل الحالية.

  إذا كنت ترغب في الحصول على نسخة تجريبية مجانية (30 يومًا) من هذه الأداة المساعدة ، الرجاء الضغط لتنزيلهثم انتقل لتطبيق العملية حسب الخطوات المذكورة أعلاه.


استخدم الزر لإظهار إخفاء الأعمدة باستخدام Kutools for Excel

أفضل أدوات إنتاجية المكتب

🤖 مساعد Kutools AI: إحداث ثورة في تحليل البيانات على أساس: التنفيذ الذكي   |  إنشاء التعليمات البرمجية  |  إنشاء صيغ مخصصة  |  تحليل البيانات وإنشاء الرسوم البيانية  |  استدعاء وظائف Kutools...
الميزات الشعبية: البحث عن التكرارات أو تمييزها أو تحديدها   |  حذف الصفوف الفارغة   |  دمج الأعمدة أو الخلايا دون فقدان البيانات   |   جولة بدون صيغة 
سوبر بحث: معايير متعددة VLookup    VLookup ذات القيمة المتعددة  |   VLookup عبر أوراق متعددة   |   بحث غامض ....
قائمة منسدلة متقدمة: إنشاء القائمة المنسدلة بسرعة   |  القائمة المنسدلة التابعة   |  قائمة منسدلة متعددة التحديد ....
مدير العمود: إضافة عدد محدد من الأعمدة  |  نقل الأعمدة  |  تبديل حالة رؤية الأعمدة المخفية  |  مقارنة النطاقات والأعمدة 
الميزات المميزة: التركيز على الشبكة   |  عرض تصميم   |   شريط الفورمولا الكبير    مدير المصنفات والأوراق   |  مكتبة الموارد (النص السيارات)   |  منتقي التاريخ   |  اجمع أوراق العمل   |  تشفير/فك تشفير الخلايا    إرسال رسائل البريد الإلكتروني عن طريق القائمة   |  سوبر تصفية   |   مرشح خاص (تصفية غامق / مائل / يتوسطه خط ...) ...
أفضل 15 مجموعة أدوات12 نص الأدوات (إضافة نص, إزالة الأحرف، ...)   |   +50 رسم الأنواع (مخطط جانت، ...)   |   40+ عملي الصيغ (احسب العمر على أساس تاريخ الميلاد، ...)   |   19 إدخال الأدوات (أدخل رمز الاستجابة السريعة, إدراج صورة من المسار، ...)   |   12 تحويل الأدوات (أرقام إلى كلمات, نتيجة تحويل عملة، ...)   |   7 دمج وتقسيم الأدوات (الجمع بين الصفوف المتقدمة, تقسيم الخلايا، ...)   |   ... و اكثر

عزز مهاراتك في Excel باستخدام Kutools for Excel، واختبر كفاءة لم يسبق لها مثيل. يقدم Kutools for Excel أكثر من 300 ميزة متقدمة لتعزيز الإنتاجية وتوفير الوقت.  انقر هنا للحصول على الميزة التي تحتاجها أكثر...

الوصف


يجلب Office Tab الواجهة المبوبة إلى Office ، ويجعل عملك أسهل بكثير

  • تمكين التحرير والقراءة المبوبة في Word و Excel و PowerPointوالناشر والوصول و Visio والمشروع.
  • فتح وإنشاء مستندات متعددة في علامات تبويب جديدة من نفس النافذة ، بدلاً من النوافذ الجديدة.
  • يزيد من إنتاجيتك بنسبة 50٪ ، ويقلل مئات النقرات بالماوس كل يوم!
Comments (17)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Hello, I hope you are well.
If you can help me... I'd appreciate it. I would like to include an image in the button, would it be possible to place it directly in this code?
Rated 4 out of 5
This comment was minimized by the moderator on the site
Hi Eliza,

You can add a picture to a Toggle Button using its "Picture" property. Here's how to do it:
Right click the button and select Properties, in the Properties dialog box, go to the Categoried tab, look for the "Picture" property, click the ellipsis (...) next to the "Picture" property to open the file dialog and then you can select the picture you want.
This comment was minimized by the moderator on the site
Hi, Crystal
It doesn't work perfectly as I wanted, I had already tried... But I managed to do it another way. Thanks for the help! :)
Your content is very educational and helps many people, keep it up.
Rated 5 out of 5
This comment was minimized by the moderator on the site
Olá, espero que você esteja bem.
Se conseguir me ajudar.. agradeço. Gostaria de incluir uma imagem no botão, seria possível colocar diretamente nesse código?
This comment was minimized by the moderator on the site
Hi what is the code to hide rows instead of columns
Thanks
This comment was minimized by the moderator on the site
Hi Andy,
This VBA code can help. Please give it a try. Thank you.
You need to change the row number in the xAddress line to the rows you want to hide.
Private Sub ToggleButton1_Click()
'Updated by Extendoffice 20230915
Dim xAddress As String
xAddress = "5:10"
If ToggleButton1.Value Then
    Application.ActiveSheet.Rows(xAddress).Hidden = True
Else
    Application.ActiveSheet.Rows(xAddress).Hidden = False
End If
End Sub
This comment was minimized by the moderator on the site
Bonjour,

Top cela fonctionne bien !!

Cependant dans mon cas de figure je masque plusieurs groupes de colonnes ( ex : un bouton 1 pour masquer les colonnes D:E et un bouton 2 pour masquer les colonnes I:K). Comment faire pour que je puisse masquer un groupe de colonnes de façon indépendante et que je ne sois pas obligé d'activer le bouton 1 afin de pouvoir activer le bouton 2 ?

Je débute merci d'avance :)
This comment was minimized by the moderator on the site
Great written tutorial, but how do I create this button on a shared Excel sheet?
This comment was minimized by the moderator on the site
Hi Madison Taylor Delgado,
Are your workbooks shared on OneDrive or other applications? I am not able to solve this problem yet. Sorry for that.
This comment was minimized by the moderator on the site
Bom dia!

Eu gostaria de ajuda com um código para Control ActiveX onde eu pudesse selecionar colunas intercaladas.

Obrigado
This comment was minimized by the moderator on the site
I tried the formula on 3 buttons. The problem is they hide and unhide according to the sequenced they are inputted in the code. Is there anyway that I can click any button that will show/hide the columns not in sequence?
This comment was minimized by the moderator on the site
Adding to Ryan's comment, how about hiding a column based on the value of a cell? Basically making the xAdress an IF-function and not a predetermined range of columns.
This comment was minimized by the moderator on the site
Dear Liz,

Thank you for your comment!

VBA code in this tutorial can help you hiding specified columns based on the value of a cell. Please follow the below hyperlink to know more details.
https://www.extendoffice.com/documents/excel/2682-excel-hide-columns-based-on-dropdown-list.html
This comment was minimized by the moderator on the site
Hi there, How would you change it to select a bunch of non-adjacent cells?
This comment was minimized by the moderator on the site
Dear Ryan,

If you need to select a bunch of non-adjacent cells (every selected cell is interval of X cell) as below screenshot shown, please try the Select Interval Rows & Columns utility of Kutools for Excel.

You can also follow this link to know more about this feature. Thank you!
https://www.extendoffice.com/product/kutools-for-excel/excel-select-interval-rows-or-columns.html
This comment was minimized by the moderator on the site
Dear Ryan,

About the bunch of non-adjacent cells you need to select, can you provide a screenshot to show where they locating in your worksheet?
Thank you for your comment.
This comment was minimized by the moderator on the site
This was very helpful, thanks!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations