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

كيفية تنشيط الخلايا للتحرير بنقرة واحدة في Excel؟

تتحدث هذه المقالة عن تنشيط الخلايا للتحرير بنقرة واحدة في Excel. يرجى القيام بما يلي خطوة بخطوة.

تنشيط الخلايا للتحرير بنقرة واحدة بواسطة رمز VBA


قم بتنشيط الخلية للتحرير بنقرة واحدة بواسطة رمز VBA

يمكن أن تساعدك التعليمات البرمجية لـ VBA التالية على تنشيط الخلايا لتحريرها بنقرة واحدة.

1. افتح ورقة العمل التي تريدها لتنشيط الخلايا بنقرة واحدة. انقر بزر الماوس الأيمن فوق علامة تبويب الورقة وانقر عرض الرمز من قائمة النقر بزر الماوس الأيمن.

2. في الافتتاح ميكروسوفت فيسوال باسيك للتطبيقات نافذة ، انسخ والصق رمز VBA أدناه في ملف رمز نافذة.

رمز فبا: تنشيط الخلية للتحرير بنقرة واحدة

#If Win64 Then
'Updated by Extendoffice 2018/2/2
    Private Declare PtrSafe Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Private Declare PtrSafe Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
#Else
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
#End If
Const VK_NUMLOCK = 144
Const VK_CAPITAL = 20
Const VK_SCROLL = 145
Dim xOldNLState As Long
Dim xOldCLState As Long
Dim xOldSLState As Long
Const KEY_MASK As Integer = &HFF80 '

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If (GetKeyState(vbKeyShift) And KEY_MASK) <> 0 Then Exit Sub
    xOldNLState = GetAsyncKeyState(VK_NUMLOCK)
    xOldCLState = GetAsyncKeyState(VK_CAPITAL)
    xOldSLState = GetAsyncKeyState(VK_SCROLL)
    SendKeys "{F2}"
    If GetAsyncKeyState(VK_NUMLOCK) <> xOldNLState Then
        Application.SendKeys "{NUMLOCK}"
    End If
    If GetAsyncKeyState(VK_CAPITAL) <> xOldCLState Then
        Application.SendKeys "{CAPSLOCK}"
    End If
    If GetAsyncKeyState(VK_SCROLL) <> xOldSLState Then
        Application.SendKeys "{SCROLLLOCK}"
    End If
End Sub

3. اضغط على قديم + Q مفاتيح في نفس الوقت لإغلاق ميكروسوفت فيسوال باسيك للتطبيقات نافذة.

من الآن فصاعدًا ، عند النقر مرة واحدة على أي خلية في ورقة العمل الحالية ، سيتم تنشيط الخلية على الفور.

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

🤖 مساعد 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 (7)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
nice and understood
This comment was minimized by the moderator on the site
Is there a way to make it so that you can be in one program window an click into the window for excel and onto the cell in one click? I noticed, while it does go right to edit mode, it goes to the previous cell when you click into the program so that it still requires two clicks to start editing.
This comment was minimized by the moderator on the site
Sorry, not sure if my last post was published. Here it is again just in case:

Hey Everyone, first off, many thanks for posting this, it's a definite time saver. Just noticed that if you try to use the "Shift+tab" keyboard command to move one cell to the left, a comment box gets created instead. Anyway to fix this issue? Thanks!
This comment was minimized by the moderator on the site
Dear Wayne,
The code is now updated with the problem fixed. Thank you for your feedback.
This comment was minimized by the moderator on the site
Hey Everyone, first off, many thanks for posting this, it's a definite time saver. Just noticed that if you try to use the "Shift+tab" to move one cell to the left, a comment box gets created instead. Anyway to fix this issue? Thanks!
This comment was minimized by the moderator on the site
Hey guys. I had a question about a strange side effect this code does when I use it in one of my worksheets.
The code I tried was the one mentioned in the post.
//
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
SendKeys "{F2}"
End Sub
//
The side effect I'm getting is when I make a cell active my Numlock turns off/on.
Any help would be appreciated.
This comment was minimized by the moderator on the site
Good Day,
The code is updated with the problem solving. Thank you for your comment.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations