Note: The other languages of the website are Google-translated. Back to English
Logáil isteach  \/ 
x
or
x
Cláraigh  \/ 
x

or

Conas marc seiceála a chur i gcill le cliceáil faoi dhó in Excel?

De ghnáth, chun marc seiceála a chur isteach i gcill, ní mór duit dul isteach sa bhosca dialóige Siombail, siombail an mharc seiceála a fháil agus é a chur isteach de láimh. Ach níl sé chomh furasta siombail an mharc seiceála a fháil amach sa bhosca dialóige Siombail mar tá go leor siombailí liostaithe istigh. Conas marc seiceála a chur go tapa i gcill in Excel? Taispeánfaidh an t-alt seo modh VBA duit chun marc seiceála a chur go héasca i gcill le cliceáil dúbailte amháin.

Cliceáil faoi dhó chun marc seiceála a chur i gcill le cód VBA


Cliceáil faoi dhó chun marc seiceála a chur i gcill le cód VBA

Is féidir leis an gcód VBA seo a leanas cabhrú leat marc seiceála a chur i gcill le cliceáil dúbailte. Déan mar a leanas le do thoil.

1. Oscail an bhileog oibre a theastaíonn uait chun marc seiceála a chur isteach sa chill, ansin cliceáil ar dheis agus roghnaigh Féach an cód ón roghchlár cliceáil ar dheis.

2. Sa Microsoft Visual Basic d’Fheidhmchláir an cód VBA thíos a fhuinneog, a chóipeáil agus a ghreamú isteach sa cód fhuinneog.

Cód VBA: Cliceáil faoi dhó chun an marc seiceála a chur i gcill

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Range("B1:B10")) Is Nothing Then
        Application.EnableEvents = False
        If ActiveCell.Value = ChrW(&H2713) Then
            ActiveCell.ClearContents
        Else
            ActiveCell.Value = ChrW(&H2713)
        End If
        Cancel = True
    End If
    Application.EnableEvents = True
End Sub

nótaí: Sa chód, is é B1: B10 an raon a chuirfidh tú marc seiceála le cliceáil dúbailte. Athraigh é le do thoil bunaithe ar do riachtanas.

3. Brúigh an Eile + Q eochracha chun an Microsoft Visual Basic d’Fheidhmchláir fuinneog agus filleadh ar an mbileog oibre.

Anois, cliceáil faoi dhó ar aon chill i raon B1: B10, cuirfear an marc seiceála isteach go huathoibríoch. Agus an cill á chliceáil faoi dhó arís, bainfear an marc seiceála a cuireadh isteach.

Más gá duit na marcanna seiceála a úsáid go minic i d’obair laethúil Excel, molaim anseo an Téacs Auto Fóntais de Kutools le haghaidh Excel. Leis an ngné seo, is féidir leat marc seiceála a shábháil mar iontráil téacs uathoibríoch, agus ansin é a atosú sa todhchaí gan ach cliceáil amháin in Excel mar an taispeántas thíos a thaispeántar.
Íoslódáil agus bain triail as anois! (Conair saor in aisce 30 lá)


Earraí gaolmhara:


Na hUirlisí Táirgiúlachta Oifige is Fearr

Réitíonn Kutools for Excel an chuid is mó de do chuid Fadhbanna, agus Méadaíonn sé do Tháirgiúlacht 80%

  • Athúsáid: Cuir isteach go tapa foirmlí casta, cairteacha agus aon rud a d'úsáid tú roimhe seo; Cealla a Chriptiú le pasfhocal; Cruthaigh Liosta Ríomhphoist agus seol ríomhphoist ...
  • Barra Foirmle Super (cuir línte iolracha téacs agus foirmle in eagar go héasca); Leagan Amach Léitheoireachta (líon mór cealla a léamh agus a chur in eagar go héasca); Greamaigh go dtí an Raon Scagtha...
  • Cumaisc Cealla / Sraitheanna / Colúin gan Sonraí a chailleadh; Ábhar Cealla Scoilt; Comhcheangail Sraitheanna / Colúin Dúblacha... Cill Dúblach a Chosc; Déan comparáid idir Ranganna...
  • Roghnaigh Dúblach nó Uathúil Sraitheanna; Roghnaigh Blank Rows (tá na cealla uile folamh); Aimsigh Super agus Fuzzy Aimsigh i go leor Leabhar Oibre; Roghnaigh go randamach ...
  • Cóip Díreach Cealla Il gan tagairt fhoirmle a athrú; Tagairtí Cruthaigh Auto chuig Bileoga Il; Cuir Urchair isteach, Boscaí Seiceála agus go leor eile ...
  • Sliocht Téacs, Cuir Téacs leis, Bain de réir Poist, Bain Spás; Subtotals Paging a chruthú agus a phriontáil; Tiontaigh Idir Ábhar Cealla agus Tráchtanna...
  • Scagaire Super (scéimeanna scagaire a shábháil agus a chur i bhfeidhm ar bhileoga eile); Ard-Sórtáil de réir míosa / seachtaine / lae, minicíocht agus níos mó; Scagaire Speisialta le cló trom, iodálach ...
  • Comhcheangail Leabhair Oibre agus Bileoga Oibre; Cumaisc Táblaí bunaithe ar eochaircholúin; Roinn Sonraí i Ilbhileoga; Baisc Tiontaigh xls, xlsx agus PDF...
  • Níos mó ná 300 gné chumhachtach. Tacaíochtaí Office / Excel 2007-2019 agus 365. Tacaíonn sé le gach teanga. Imscaradh éasca i d’fhiontar nó d’eagraíocht. Gnéithe iomlána triail saor in aisce 30 lá. Ráthaíocht ar ais airgid 60 lá.
cluaisín kte 201905

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á!
bun officetab
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Michael · 1 months ago
    How do i repeat this for multiple columns? 

    For example i need it in the following:

    E, F, I, J, M, N ,Q, R, U, V, Y, Z, AC, AD, AG, AH, AK, AL, AO, AP, AS, AT, AW, AX
  • To post as a guest, your comment is unpublished.
    Dan · 2 months ago
    Hi crystal

    is there a way to have checkmarks in A1:A10 along with B3:B10?
  • To post as a guest, your comment is unpublished.
    CSherrod · 9 months ago
    Hi there!  What would I add to the above code to get the cell to change color when the check box is added?
  • To post as a guest, your comment is unpublished.
    leoflute · 1 years ago
    Is there a way to loop this code so that it is on a lot of worksheets in one workbook?
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hi leoflute,
      After pressing the Alt + F11 keys to open the Microsoft Visual Basic for Applications window, please double click ThisWorkbook to open the ThisWorkbook(Code) window, and then copy the below code into the code window. Don't forget to change the sheet names and the cell range in the code.
      Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) 'Updated by Extendoffice 20201012 Dim xStrRg, xStrWs, xStrWsName As String Dim xEEBol, xWSNBol, xBol As Boolean Dim xArrWs Dim xArrRg Dim xI, xJ As Integer Dim xWs As Worksheet Dim xRg As Range xStrWs = "Sheet5,Sheet1,Sheet2" 'The specific worksheet names xStrRg = "B3:B10" 'The range of cells you will insert check marks xArrWs = Split(xStrWs, ",") xArrRg = Split(xStrRg, ",") xEEBol = Application.EnableEvents Application.EnableEvents = False On Error Resume Next xStrWsName = Sh.Name xBol = False xWSNBol = False For xI = 0 To UBound(xArrWs) If xStrWsName = xArrWs(xI) Then xWSNBol = True Exit For End If Next xI If xWSNBol Then Set xWs = Application.Worksheets.Item(xArrWs(xI)) For xJ = 0 To UBound(xArrRg) Set xRg = Sh.Range(xArrRg(xJ)) If Not Intersect(Target, xRg) Is Nothing Then xBol = True Exit For End If Next xJ End If If xBol Then If ActiveCell.Value = ChrW(&H2713) Then ActiveCell.ClearContents Else ActiveCell.Value = ChrW(&H2713) End If Cancel = True End If Application.EnableEvents = xEEBol End Sub

  • To post as a guest, your comment is unpublished.
    Luiz Carlos Dias · 3 years ago
    como eu faço pra inserir a marca de seleção na célula, porém sem deletar o número que estiver digitado nela ou seja, a marca sairia na frente do número quando eu der duplo clique... e quando eu quizer apagar a marca, eu dou duplo clique novamente e a célula voltaria ao normar (continuaria apenas o número).
    • To post as a guest, your comment is unpublished.
      Tadao Kano · 3 years ago
      Ola Luiz, tente essa alteracao. Ira funcionar nas celulas A2:A10 e D2:D5, altere conforme sua necessidade.

      Tadao


      Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
      If Not Intersect(Target, Union(Range("A2:A10"), Range("D2:D5"))) Is Nothing Then
      Application.EnableEvents = False
      If Left(ActiveCell.Value, 1) = ChrW(&H2713) Then
      ActiveCell.Value = Right(ActiveCell, Len(ActiveCell) - 1)
      ActiveCell.HorizontalAlignment = xlRight
      Else
      ActiveCell.Value = ChrW(&H2713) & ActiveCell.Value
      End If
      Cancel = True
      End If
      Application.EnableEvents = True
      End Sub