VBA code

kellydanthuy

New Member
Joined
Jan 30, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
1706624430707.png

Hi All,

How can I update the code below if I would like to add one more column as picture?

Thank you for you all advice.

Option Explicit


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

On Error Resume Next
With Application
.Cursor = xlNorthwestArrow
BooleanCellDoubleClick Target, [Checklist_Table[[Done]]], Cancel
.Cursor = xlDefault
End With

End Sub


Private Sub BooleanCellDoubleClick(rTarget As Range, rValidRange As Range, Cancel As Boolean)

On Error Resume Next
Application.CellDragAndDrop = False

If rTarget.Cells.Count > 1 Then Exit Sub
If Intersect(rTarget, rValidRange) Is Nothing Then Exit Sub

If Len(rTarget) Then
rTarget = vbNullString
Else
rTarget = 1
End If

Cancel = True

End Sub
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You should explain what you need to do and which columns of the shown table should be involved
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top