Does a "Flip flop" option exist

UHsoccer

Well-known Member
Joined
Apr 3, 2002
Messages
1,023
I like to click on a field and if the value was Yes, then it would switch to No (and vice versa)
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
No. But you can make one using an event macro.

In a sheet module, try,

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

If Target = "Yes" Then
Target = "No"
GoTo E:
End If
If Target = "No" Then Target = "Yes"
E:
Target.Offset(1, 0).Select
End Sub
 
Upvote 0
Jay, Thanks for the response

Never worked with a program like that

Added it (as you wrote it) under Tools / Macro, but have a feeling that is not the proper way to do it.

Suggestion?
 
Upvote 0
On 2002-04-30 07:32, UHsoccer wrote:
Jay, Thanks for the response

Never worked with a program like that

Added it (as you wrote it) under Tools / Macro, but have a feeling that is not the proper way to do it.

Suggestion?

Hi,

You have placed it in a regular code module. It needs to go in a sheet module ( a place where the special event-triggered macros are offered by MS). These are different beasts, in general, and are separated from the ones you write and record.

Right click on the sheet tab click "View Code" and then paste the code. Delete it from the code module and you should be set.

HTH,
Jay
 
Upvote 0

Forum statistics

Threads
1,213,552
Messages
6,114,278
Members
448,559
Latest member
MrPJ_Harper

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