VB Script worked and now doesnt

dsami0122

New Member
Joined
Mar 31, 2016
Messages
40
Office Version
  1. 365
Platform
  1. Windows
I have a script I added to a worksheet to double click a check mark and since adding columns its not working.

Anyone know a fix? Check marks start in Column 7

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column >= 7 Then
Cancel = True
Target.Font.Name = "Wingdings"
If Target.Value = "" Then
Target.Value = "ü"
Else
Target.Value = ""
End If
End If
End Sub
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi & welcome to MrExcel.
In what way isn't it working?
 
Upvote 0
Hi & welcome to MrExcel.
In what way isn't it working?
I have added columns and now the columns with the checks and not enabled I double click and nothing happens. Its as if they have reverted back to just plain text boxes
 
Upvote 0
You're code has nothing to do with textboxes (or any other controls) it's just about double clicking a cell.
Which columns do you want this to work on?
 
Upvote 0
You're code has nothing to do with textboxes (or any other controls) it's just about double clicking a cell.
Which columns do you want this to work on?
I want it to work in columns H-Q, the code is to use wingdings and when you double click the cell it enters a check mark
 
Upvote 0
I want it to work in columns H-Q, the code is to use wingdings and when you double click the cell it enters a check mark
1613499052517.png
 
Upvote 0
That's exactly what you code should do.
Is the sheet protected?
 
Upvote 0
Ok, add the word Stop as shown
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Stop
If Target.Column >= 7 Then
Then double click in col H, what happens?
 
Upvote 0
Ok, add the word Stop as shown
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Stop
If Target.Column >= 7 Then
Then double click in col H, what happens?
Its fixed thanks
 
Upvote 0

Forum statistics

Threads
1,213,538
Messages
6,114,218
Members
448,554
Latest member
Gleisner2

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