VB Script worked and now doesnt

dsami0122

New Member
Joined
Mar 31, 2016
Messages
6
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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,533
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
In what way isn't it working?
 

dsami0122

New Member
Joined
Mar 31, 2016
Messages
6
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
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,533
Office Version
  1. 365
Platform
  1. Windows
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?
 

dsami0122

New Member
Joined
Mar 31, 2016
Messages
6

ADVERTISEMENT

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
 

dsami0122

New Member
Joined
Mar 31, 2016
Messages
6
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
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,533
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

That's exactly what you code should do.
Is the sheet protected?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,533
Office Version
  1. 365
Platform
  1. Windows
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?
 

dsami0122

New Member
Joined
Mar 31, 2016
Messages
6
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
 

Watch MrExcel Video

Forum statistics

Threads
1,129,498
Messages
5,636,677
Members
416,935
Latest member
Atulcp

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
Top