Skip to main content

Conas téacs i mbosca téacs a thiontú go hábhar cille in Excel?

Má tá roinnt boscaí téacs i mbileog, agus gur mhaith leat an t-ábhar sna boscaí téacs a thiontú ina gcealla ar leithligh mar atá thíos an pictiúr a thaispeántar, an bhfuil aon bhealaí gasta ann chun an post seo a réiteach ach dul isteach ceann ar cheann in Excel? San Airteagal seo, tugaim isteach macra chun fabhar a thabhairt duit ar an bhfadhb seo.
bosca téacs a thiontú go cill 1

Tiontaigh ábhar an bhosca téacs go cill le VBA


mboilgeog cheart gorm saighead Tiontaigh ábhar an bhosca téacs go cill le VBA

Seachas macra-chód, níl aon chleas ann a fhéadann boscaí téacs a thiontú go hábhar cille go tapa.

1. Brúigh Alt + F11 eochracha le cumasú Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

2. cliceáil Ionsáigh > Modúil, agus ansin greamaigh thíos an cód leis an Modúil script.

VBA: Tiontaigh boscaí téacs go cill

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

bosca téacs a thiontú go cill 2

3. Brúigh F5 eochair chun an cód a rith, tagann dialóg amach le cur i gcuimhne duit cill a roghnú chun ábhar an bhosca téacs a easpórtáil. Féach an pictiúr:
bosca téacs a thiontú go cill 3

4. cliceáil OK. Anois tá gach bosca téacs tiontaithe go hábhar cille.
bosca téacs a thiontú go cill 4

Leid: Os cionn VBA bainfidh na boscaí téacs tar éis iad a rith, más mian leat na boscaí téacs a choinneáil, athraigh an cód le do thoil xTxtBox.Scrios chun 'xTxtBox.Scrios.

síneadh:Más mian leat tiontú go tapa idir uimhir agus téacs, déan iarracht na Kutools a úsáid le haghaidh Excel's Tiontaigh idir Téacs agus Uimhir mar a thaispeántar sa phictiúr a leanas. Tá sé ag feidhmiú go hiomlán gan teorainn i

Kutools le haghaidh Excel, le níos mó ná 300 feidhmeanna úsáideacha, déanann sé do phoist níos éasca. 
lá, íoslódáil agus triail saor in aisce anois.
bosca téacs a thiontú go cill 5

Uirlisí Táirgiúlachta Oifige is Fearr

🤖 Kutools AI Aide: anailís sonraí a réabhlóidiú bunaithe ar: Forghníomhú Chliste   |  Gin Cód  |  Cruthaigh Foirmlí Saincheaptha  |  Anailís a dhéanamh ar Sonraí agus Cairteacha a Ghin  |  Feidhmeanna Kutools a agairt...
Gnéithe Coitianta: Faigh, Aibhsigh nó Aithnigh Dúblaigh   |  Scrios Sraitheanna Bána   |  Comhcheangail Colúin nó Cealla gan Sonraí a Chailleadh   |   Babhta gan Foirmle ...
Cuardaigh Super: Ilchritéir VLookup    VLookup Illuachanna  |   VLookup Trasna Ilbhileoga   |   Amharc doiléir ....
Liosta anuas Casta: Go tapa Cruthaigh Liosta Anuas   |  Liosta anuas Cleithiúnach   |  Liosta Buail Isteach Ilroghnacha ....
Bainisteoir Colún: Cuir Líon Sonrach Colún leis  |  Colúin Bog  |  Scoránaigh Stádas Infheictheachta na gColún Ceilte  |  Déan comparáid idir Raonta & Colúin ...
Gnéithe Réadmhaoin: Fócas Eangaí   |  Amharc Dearaidh   |   Barra Mór na Foirmle    Leabhar Oibre & Bainisteoir Bileog   |  Leabharlann Acmhainní (Uaththéacs)   |  Piocálaí Dáta   |  Comhcheangail Bileoga Oibre   |  Criptigh/Díchriptigh Cealla    Seol Ríomhphost trí Liosta   |  Scagaire Super   |   Scagaire Speisialta (scagaire trom/iodálach/stailc tríd...) ...
Barr 15 Uirlisí12 Téacs uirlisí (Cuir Téacs, Bain Carachtair,...)   |   50 + Cairt cineálacha (Cairt Gantt,...)   |   40+ Praiticiúil Foirmlí (Ríomh aois bunaithe ar lá breithe,...)   |   19 Insertion uirlisí (Cuir isteach Cód QR, Ionsáigh Pictiúr ón gCosán,...)   |   12 Tiontú uirlisí (Uimhreacha le Focail, Comhshó Airgeadra,...)   |   7 Cumaisc & Scoilt uirlisí (Sraitheanna Comhcheangail Casta, Cealla Scoilt,...)   |   ... agus eile

Supercharge Do Scileanna Excel le Kutools le haghaidh Excel, agus Éifeachtúlacht Taithí Cosúil Ná Roimhe. Kutools le haghaidh Excel Tairiscintí Níos mó ná 300 Ardghnéithe chun Táirgiúlacht a Treisiú agus Sábháil Am.  Cliceáil anseo chun an ghné is mó a theastaíonn uait a fháil ...

Tuairisc


Tugann Tab Oifige comhéadan Tabbed chuig Office, agus Déan Do Obair i bhfad Níos Éasca

  • Cumasaigh eagarthóireacht agus léamh tabbed i Word, Excel, PowerPoint, Foilsitheoir, Rochtain, Visio agus Tionscadal.
  • Oscail agus cruthaigh cáipéisí iolracha i gcluaisíní nua den fhuinneog chéanna, seachas i bhfuinneoga nua.
  • Méadaíonn do tháirgiúlacht 50%, agus laghdaíonn sé na céadta cad a tharlaíonn nuair luch duit gach lá!

 

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