![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Location: Detroit
Posts: 792
|
I like to click on a field and if the value was Yes, then it would switch to No (and vice versa)
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
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 |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Location: Detroit
Posts: 792
|
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? |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Quote:
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 |
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Apr 2002
Location: Detroit
Posts: 792
|
This forum really works
Thank you Jay |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|