Click A Check Box To Run Macro In A To Do List In Excel || MS Excel Tutorials

Поделиться
HTML-код
  • Опубликовано: 24 июл 2024
  • In the last video we have seen how to link all check boxes with a macro in Excel. Now in this video, let us learn how to run a macro when we click on a check box.
    💥 DON'T CLICK THIS: ➡️ bit.ly/3sPIZvD
    👉 Link to download the exercise file: ➡️ bit.ly/30jt3qY
    👀 Best Laptops to use for better speed:
    1️⃣ fkrt.it/DbkzgjuuuN
    2️⃣ fkrt.it/qskFUFNNNN
    3️⃣ fkrt.it/q8RcXDNNNN
    In this example, I am considering this small To-Do list, where the checkboxes in column C are linked to cells in column D.
    Now, let us try building a macro that puts the actual date in the column F, when you tick the check box in column C.
    Go to the VBA editor window, insert a new module.
    And type the code like this.
    Sub CheckBoxDate()
    Dim ws As Worksheet
    Dim chk As CheckBox
    Dim lColD As Long
    Dim lColChk As Long
    Dim lRow As Long
    Dim rngD As Range
    lColD = 3
    Set ws = ActiveSheet
    Set chk = ws.CheckBoxes(Application.Caller)
    lRow = chk.TopLeftCell.Row
    lColChk = chk.TopLeftCell.Column
    Set rngD = ws.Cells(lRow, lColChk + lColD)
    Select Case chk.Value
    Case 1
    rngD.Value = Date
    Case Else
    rngD.ClearContents
    End Select
    End Sub
    Go to the excel now, right click the first checkbox and click on Assign macro, In the list of macros, click CheckBoxDate, then click OK.
    VBA-2:
    Sub CheckBoxMacro()
    Dim chk As CheckBox
    For Each chk In ActiveSheet.CheckBoxes
    chk.OnAction = "CheckBoxDate"
    Next chk
    End Sub
    ▶️Best Equipment & Tools for RUclips Channel : ➡️ bit.ly/3inKa1P
    📒Our Recommendations
    ***************************************************************
    📗Oracle Primavera Tutorials : bit.ly/3fn9PFH
    📗Microsoft Excel Tutorials : bit.ly/2V5de5l
    📗Microsoft Project Tutorials : bit.ly/37guNl7
    For personalized detail learning, write to 📥 info@dptutorials.com
    If you found this video valuable, give it a like. If you know someone who needs to see it, share it. Leave a comment below with your thoughts. Add it to a playlist if you want to watch it later.
    ***********************************************
    ★ My Online Tutorials ► www.dptutorials.com
    ⚡️LEARNING RESOURCES I Recommend: www.dptutorials.com/resources
    ⚡️Subscribe for more Awesome Tutorials: goo.gl/NyAtg2
    ⚡️Support the Channel via shopping: amzn.to/2ZRfTOZ ift.tt/2jH38PR
    ⚡️Tools for RUclips vlogging:
    ***********************************************
    • Laptop: amzn.to/2UqFu1K
    • Canon 200D Camera: amzn.to/3gcfbUT
    • Benro Tripod: amzn.to/3D0fQ5l
    • Microphone: amzn.to/2XDiOg7
    • Collar Microphone: amzn.to/3miLB3X
    • Screen recorder: techsmith.pxf.io/2BMjA
    • Boom Arm Stand: amzn.to/3gaVDQs
    • Zoom H1 Audio Recorder: amzn.to/3AMpkzg
    • Harison Softbox Studio Lights: amzn.to/2W7ZuXi
    • Chroma Key Green Screen: amzn.to/3gdjCP9
    • Background Support Stand: amzn.to/3m9Ej2l
    • Acoustic Foam Background: amzn.to/3xYv07E
    • USB RGB LED Strip: amzn.to/3g9k4xO
    • Wireless Mouse: amzn.to/2XxqMqV
    ***********************************************
    ⚡️You Can Connect with Me at:
    ***********************************************
    💎RUclips: / dptutorials
    💎Instagram: / dptutorials
    💎G+: ift.tt/2kAOpa6
    💎Twitter: / dptutorials15
    💎Facebook: ift.tt/2kfRnDi
    💎BlogSpot: ift.tt/2kB14dh
    💎Websites: www.dptutorials.com &
    💎www.askplanner.blogspot.com
    💎Telegram: t.me/dptutorials16
    #dptutorials #primavera #primaverafree #exceltraining #exceltricks #exceltips #excelfreetraining #excelfreelearning
    ⚡️Tags: -
    excel formulas in english, excel in english, excel tutorial in english,ms excel in english,ms excel tutorial in english, learn excel in english,vlookup in excel in english, learn ms excel in english, excel training, excel tutorial, microsoft excel 2007, learn excel,tutorial excel, ms excel tutorial, excel tutorials,ms excel 2007,microsoft excel training,learn excel online,learning excel,free excel training,online excel training,advanced excel tutorial,excel tutorial, excel formulas and functions, excel formulas, excel tutorial in hindi, excel formulas and functions in hindi, excel tricks, excel in hindi, excel shortcut keys, excel vlookup, excel formulas in hindi, excel for beginners, excel for accounting, excel formulas and functions tutorial, excel sum formula, sum formula series, excel attendance sheet, excel salary sheet, excel stock maintain, excel data entry, advanced excel tutorial,excel formulas,excel tutorial,vlookup excel,excel accounting
    🎁Note: This description contains affiliate links, which means at no additional cost to you, we will receive a small commission if you make a purchase using the links. This helps support the channel and allows us to continue to make videos like this. Thank you for your support!

Комментарии • 5

  • @quiqueenrikx3992
    @quiqueenrikx3992 2 года назад +1

    Great video. Thanks mate

  • @pallavimayekar9621
    @pallavimayekar9621 2 года назад +1

    Thanks for the lovely tutorial .How can we modify above code to add Date & Time, I am unable to do that :(

    • @dptutorials
      @dptutorials  2 года назад

      Thanks a lot. Let me check, in the meanwhile could you ping me at info@dptutorials.com.

  • @renzomarquinaasto8390
    @renzomarquinaasto8390 Год назад

    Hi, i tried your code in the same sample but I got an error in the next line:
    "Set chk = ws.CheckBoxes(Application.Caller)" says (Error1004)
    I don't know if its because of the excel version (2021 LTSC) or something else, hope you can help me.
    Thanks in advance.