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

كيفية تحويل النص في مربع النص إلى محتوى الخلية في إكسيل؟

إذا كانت هناك بعض مربعات النص في ورقة ، وتريد تحويل المحتويات في مربعات النص إلى خلايا بشكل منفصل كما هو موضح أدناه ، فهل هناك أي طرق سريعة لحل هذه المهمة باستثناء إدخال واحدًا تلو الآخر في Excel؟ في هذه المقالة ، أعرض ماكرو لتقديم خدمة لك في هذه المشكلة.
doc تحويل مربع النص إلى الخلية 1

تحويل محتويات مربع النص إلى خلية باستخدام VBA


السهم الأزرق الحق فقاعة تحويل محتويات مربع النص إلى خلية باستخدام VBA

باستثناء التعليمات البرمجية للماكرو ، لا توجد حيلة يمكنها تحويل مربعات النص إلى محتويات الخلية بسرعة.

1. صحافة ALT + F11 مفاتيح للتمكين ميكروسوفت فيسوال باسيك للتطبيقات نافذة.

2. انقر إدراج > وحدة، ثم الصق الكود أدناه في ملف وحدة النصي.

فبا: تحويل مربعات النص إلى خلية

Sub TextboxesToCell()
'UpdatebyExtendoffice20160918
    Dim xRg As Range
    Dim xRow As Long
    Dim xCol As Long
    Dim xTxtBox As TextBox
    
    Set xRg = Application.InputBox("Select a cell):", "Kutools for Excel", _
                                    ActiveWindow.RangeSelection.AddressLocal, , , , , 8)
    xRow = xRg.Row
    xCol = xRg.Column
    
    For Each xTxtBox In ActiveSheet.TextBoxes
        Cells(xRow, xCol).Value = xTxtBox.Text
        xTxtBox.Delete
        xRow = xRow + 1
    Next
    
End Sub

doc تحويل مربع النص إلى الخلية 2

3. صحافة F5 مفتاح لتشغيل الكود ، يظهر مربع حوار لتذكيرك بتحديد خلية لتصدير محتويات مربع النص. انظر لقطة الشاشة:
doc تحويل مربع النص إلى الخلية 3

4. انقر OK. الآن تم تحويل جميع مربعات النص إلى محتويات الخلية.
doc تحويل مربع النص إلى الخلية 4

نصيحة: فوق VBA ستزيل مربعات النص بعد التشغيل ، إذا كنت تريد الاحتفاظ بمربعات النص ، فيرجى تغيير الكود xTxtBox.Delete إلى xTxtBox.Delete.

التمديد:إذا كنت تريد التحويل بسرعة بين الرقم والنص ، فيرجى محاولة استخدام Kutools for Excel التحويل بين النص والرقم كما هو موضح في الصورة التالية. إنها تعمل بكامل طاقتها دون قيود

كوتولس ل إكسيل, مع أكثر من 300 وظائف يدوية ، تجعل مهامك أكثر سهولة. 
أيام، يرجى التنزيل والحصول على نسخة تجريبية مجانية الآن.
doc تحويل مربع النص إلى الخلية 5

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

🤖 مساعد 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 (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I am using this script (thanks by the way), but i am trying to get it so that it populates a specific cell and not ask for a cell input each time. what would I change so that it auto populates for example cell B2.

Cheers
This comment was minimized by the moderator on the site
Hi, just change the script
Set xRg = Application.InputBox("Select a cell):", "Kutools for Excel", _
                                    ActiveWindow.RangeSelection.AddressLocal, , , , , 8)

to
Set xRg = Application.Range("B2")

you will insert textbox contents from cell B2
This comment was minimized by the moderator on the site
Hi, sunny. I want a solution in excel. I have copied and pasted a web page containing data. in that, each text box contains some numbers. I am unable to convert it as a regular number in an excel cell containing a particular column. I am using excel 2007.Your text to link
This comment was minimized by the moderator on the site
Hi, sunny. I want a solution in excel. I have copied and pasted a web page containing data. in that, each text box contains some numbers. I am unable to convert it as a regular number in an excel cell containing a particular column. I am using excel 2007.
This comment was minimized by the moderator on the site
hi, I tried in Excel365 and it doesn't work, I get the popup and then I fill in but then nothing happens, thanks for the help, Michel
This comment was minimized by the moderator on the site
Hi, Michel, I have tested the code in Excel 365, it works correctly. Could you give me a picture about your Excel version like this (File > Account)https://www.extendoffice.com/images/stories/comments/sun-comment/Excel_version.png, and the picture about your textboxes contents?
This comment was minimized by the moderator on the site
No me funcionó. Hago todo lo señalado y no pasa nada después de apretar enter. Intenté algunos cambios en la programación y tampoco
This comment was minimized by the moderator on the site
Hi, Juan, there is no Enter key mentioned in the method above, copy and paste the vba, then press F5 key or click the Run button to enable the code.
This comment was minimized by the moderator on the site
Muchas gracias! Buen aporte. Me ayudó mucho.
This comment was minimized by the moderator on the site
Okay, I have Textbox inside Textbox that need to be extracted.
This comment was minimized by the moderator on the site
VBA not working?!
This comment was minimized by the moderator on the site
It works perfectly here. What happen while you running the code? It changes nothing? If you could, please describ more about your data and problem. Thank you.
This comment was minimized by the moderator on the site
I have many Boxes in different sheets, There are 4 sheets which are having particular events on particular day and i would like to take that text boxes of particular day to new sheet combined for that day, How it works i have no idea how to get that data from 4 different sheet to one sheet.
This comment was minimized by the moderator on the site
Not working here either. Select destination cell, click OK, and nothing happens.
This comment was minimized by the moderator on the site
I have tried it in Win10 Excel2016 and Win8 Excel2010, it works both. What working enviroment you use?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations