Skip to main content

Conas il-earraí a roghnú ón liosta anuas i gcill in Excel?

Úsáidtear an liosta anuas go minic in obair laethúil Excel. De réir réamhshocraithe, ní féidir ach mír amháin a roghnú ar liosta anuas. Ach i roinnt uaireanta, b’fhéidir go mbeidh ort míreanna iolracha a roghnú ón liosta anuas in aon chill amháin mar atá thíos an pictiúr a thaispeántar. Conas is féidir leat é a láimhseáil in Excel?

roghnaigh doc míreanna éagsúla ón liosta anuas 1 saighead doc ar dheis roghnaigh doc míreanna éagsúla ón liosta anuas 2

Roghnaigh míreanna iolracha ón liosta anuas i gcill le VBA

Roghnaigh míreanna iomadúla ón liosta anuas isteach i gcill go héasca agus go tapa


Roghnaigh míreanna iolracha ón liosta anuas i gcill le VBA

Seo roinnt is féidir le VBA fabhar a dhéanamh duit maidir leis an bpost seo a réiteach.

Roghnaigh míreanna dúblacha ón liosta anuas i gcill

1. Tar éis liosta anuas a chruthú, cliceáil ar dheis ag an táb bileog chun roghnú Féach an cód ón roghchlár comhthéacs.
roghnaigh doc míreanna éagsúla ón liosta anuas 3

2. Ansin sa Microsoft Visual Basic d’Fheidhmchláir fuinneog, cóipeáil agus greamaigh faoin gcód leis an script bán.

VBA: Roghnaigh míreanna iolracha ón liosta anuas i gcill

Private Sub Worksheet_Change(ByVal Target As Range)
'UpdatebyExtendoffice20221111
    Dim xRgVal As Range
    Dim xStrNew As String
    On Error Resume Next
    Set xRgVal = Cells.SpecialCells(xlCellTypeAllValidation)
    If (Target.Count > 1) Or (xRgVal Is Nothing) Then Exit Sub
    If Intersect(Target, xRgVal) Is Nothing Then Exit Sub
    If Target.Value = "" Then Exit Sub
    Application.EnableEvents = False
    xStrNew = Target.Value
    Application.Undo
    If xStrNew = Target.Value Then
    Else
    xStrNew = xStrNew & " " & Target.Value
    Target.Value = xStrNew
    End If
    Application.EnableEvents = True
End Sub

3. Sábháil an cód agus dún an fhuinneog chun dul ar ais chuig an liosta anuas. Anois is féidir leat míreanna iomadúla a roghnú ón liosta anuas.

Tabhair faoi deara:

1. Leis an VBA, scarann ​​sé na míreanna de réir spáis, is féidir leat athrú xStrNew = xStrNew & "" & Target.Value do dhaoine eile an teorantóir a athrú de réir mar is gá duit. Mar shampla, xStrNew = xStrNew & "," & Target.Value déanfaidh sé na míreanna a scaradh le camóga.

2. Oibríonn an cód VBA seo do gach liosta anuas ar an mbileog.

Roghnaigh míreanna iomadúla ón liosta anuas go cill gan athdhéanamh

Mura dteastaíonn uait ach míreanna uathúla a roghnú ón liosta anuas go cill, is féidir leat na céimeanna thuas a athdhéanamh agus an cód thíos a úsáid.

VBA : Roghnaigh míreanna iolracha ón liosta anuas go cill gan athdhéanamh

Private Sub Worksheet_Change(ByVal Target As Range)
'UpdatebyExtendoffice20221111
    Dim I As Integer
    Dim xRgVal As Range
    Dim xStrNew As String
    Dim xStrOld As String
    Dim xFlag As Boolean
    Dim xArr
    On Error Resume Next
    Set xRgVal = Cells.SpecialCells(xlCellTypeAllValidation)
    If (Target.Count > 1) Or (xRgVal Is Nothing) Then Exit Sub
    If Intersect(Target, xRgVal) Is Nothing Then Exit Sub
    If Target.Value = "" Then Exit Sub
    Application.EnableEvents = False
    xFlag = True
    xStrNew = " " & Target.Value & " "
    Application.Undo
    xStrOld = Target.Value
    If InStr(1, xStrOld, xStrNew) = 0 Then
        xStrNew = xStrNew & xStrOld & " "
    Else
        xStrNew = xStrOld
    End If
    Target.Value = xStrNew
    Application.EnableEvents = True
End Sub

Níl an dá chód VBA thuas suppot chun codanna d'ábhar cille a scriosadh, gan ach tacaíocht chun gach mír den chill a ghlanadh.


Roghnaigh míreanna iomadúla ón liosta anuas isteach i gcill go héasca agus go tapa

In Excel, ach amháin cód VBA, níl aon bhealaí eile ann chun míreanna iomadúla a roghnú ón liosta anuas i gcill a cheadú. Mar sin féin, tá an Liosta anuas ilroghnacha gné de Kutools le haghaidh Excel is féidir leis an bpost seo a láimhseáil go tapa agus go héasca le cad a tharlaíonn.

Leid: Sula gcuirfidh tú an uirlis seo i bhfeidhm, le do thoil suiteáil Kutools le haghaidh Excel ar dtús. Téigh go dtína íoslódáil saor in aisce anois.
Céim 1: Roghnaigh Kutools > Liosta anuas > Liosta anuas Il-roghnaithe
Céim 2: Sa Il-roghnaigh Liosta anuas dialóg, sonraigh na socruithe
  1. Socraigh raon feidhme;
  2. Sonraigh an deighilteoir le haghaidh míreanna teorann i gcill;
  3. Socraigh treo an téacs;
  4. Cliceáil OK.
    doc roghnaigh míreanna iomadúla ón liosta anuas kte 1
Toradh:

roghnaigh míreanna iomadúla ó kutools liosta anuas

nótaí: Chun gné Liosta Anuas Il-roghnaithe a úsáid, ba chóir duit Kutools le haghaidh Excel a shuiteáil ar dtús, le do thoil cliceáil le híoslódáil agus tá triail saor in aisce 30-lá agat anois.

Cruthaigh go héasca liosta anuas dinimiciúil spleách 2-leibhéal nó il-leibhéal in Excel

In Excel, tá sé casta liosta anuas 2-leibhéal nó il-leibhéal a chruthú. Seo an Liosta anuas dinimiciúil fóntais de Kutools le haghaidh Excel an féidir leat fabhar a dhéanamh. Níl le déanamh agat ach na sonraí a ordú mar a thaispeántar mar shampla, ansin roghnaigh an raon sonraí agus an raon aschuir, ansin fág faoin bhfóntas iad.  Cliceáil le haghaidh triail saor in aisce 30 lá!
doc chun cinn sraitheanna a chur le chéile
 
Kutools for Excel: le níos mó ná 300 breiseán áisiúil Excel, saor in aisce le triail gan aon teorannú i 30 lá.

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 (26)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Como posso utilizar a função com a planilha bloqueada?
This comment was minimized by the moderator on the site
Hi, Macros, try below code, it supports to select multi items in drop down list in protected sheet.
Private Sub Worksheet_Change(ByVal Target As Range)
'UpdatebyExtendoffice20221111
    Dim xRgVal As Range
    Dim xStrNew As String
    On Error Resume Next  
    xType = 0
    xType = Target.Validation.Type
    If xType <> 3 Then Exit Sub
    If (Target.Count > 1) Then Exit Sub

    If Target.Value = "" Then Exit Sub
    Application.EnableEvents = False
    xStrNew = Target.Value
    Application.Undo
    If xStrNew = Target.Value Then
    Else
    xStrNew = xStrNew & " " & Target.Value
    Target.Value = xStrNew
    End If
    Application.EnableEvents = True
End Sub

And also Kutools for Excel 26.1 and later versions supports this job in protected sheet.
This comment was minimized by the moderator on the site
¿Cómo puedo hacer para que el orden en que se coloque el texto, sea tan cuál como yo quiera?

Ejemplo:
Mi texto para la lista es:
TRAMITAR ESTE ASUNTO
COORDINAR
ANALIZAR Y RECOMENDAR

sí selecciono:
TRAMITAR ESTE ASUNTO
ANALIZAR Y RECOMENDAR

me aparece
ANALIZAR Y RECOMENDAR, TRAMITAR ESTE ASUNTO

o sea, los de abajo me aparecen primero, pero quiero que sea en el orden en que voy seleccionando...
TRAMITAR ESTE ASUNTO, ANALIZAR Y RECOMENDAR.....
This comment was minimized by the moderator on the site
Hi, Gorgelys, Kutools's multi-select drop down list can help you. The items you selected will be in the order like you want.
This comment was minimized by the moderator on the site
the code works but won't let me delete can someone please post the new code.
This comment was minimized by the moderator on the site
bonjour,
selon le premier exemple tout fonctionne très bien jusqu'à ce que je verrouille la feuille.
quand la feuille est verrouillée, je n'ai plus le choix multiple !
comment faire ?
merci par avance
This comment was minimized by the moderator on the site
Hi, sorry for that. We will upgrade our feature next version to avoid this problem. Thank you for your feekback.
This comment was minimized by the moderator on the site
Merci bcp
Mais à quand la nouvelle version ?
This comment was minimized by the moderator on the site
Hi, we have updated this version for you, but this is a beta version, please download it from this: https://download.extendoffice.com/downloads/Kutools-for-Excel/beta/26.10/KutoolsforExcelSetup.Inno.exe
If there are any problems, welcome for your feedback.
This comment was minimized by the moderator on the site
Merci,
Je vais la télécharger et essayer.
Bonne journée
This comment was minimized by the moderator on the site
Hi, the new version is in planning, since next version will upgrade multiple features, it may take somewhat time.
This comment was minimized by the moderator on the site
Hi! Como puedo usar este codigo para todo un worksheet y no solo para una pestana?
This comment was minimized by the moderator on the site
Hi, Vero, Kutools for Excel's Multi-select Drop-down List feature suports selecting multiple items from drop down list in the whole worksheet or across workbook, just specify the Specified Scope in the Multi-select Drop-down List Settings dialog.
This comment was minimized by the moderator on the site
How can I do that for the fist formula you provided :) Thanks in advanced!
This comment was minimized by the moderator on the site
Quando quero deletar alguma opção ou todas dá erro. Como posso resolver?
This comment was minimized by the moderator on the site
I am also finding that after selecting multiple items using the updated VBA code, I still cannot clear the cell, it just keeps multiplying.
Does anyone have a solution for this yet?
This comment was minimized by the moderator on the site
Hi, Rusty, the code I have updated for making it more stable. But because the cell is in data validation, blank is out of data validation, the code cannot solve this problem.
This comment was minimized by the moderator on the site
the code works but carries over across all cells and multiplies in the cells and wont allow delete can you assist?
This comment was minimized by the moderator on the site
If I create a sheet with dropdown list using checkboxes, is there a way to share this workbook with this checkboxes feature?
This comment was minimized by the moderator on the site
How would you apply this functionality but making it so that there aren't redundant values? Any help would be appreciated!
This comment was minimized by the moderator on the site
I used this "Select multiple items from drop down list to a cell without repeat"
this is what happened
1. Multiple selections happen without problems.
2. The issue is when i try to edit and remove an option. There is no way for me to remove an option. it keeps multiplying.
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