ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I insert a cell which changes value when clicked on (https://www.excelbanter.com/excel-discussion-misc-queries/224064-how-do-i-insert-cell-changes-value-when-clicked.html)

JohnRScott

How do I insert a cell which changes value when clicked on
 
I wnt to have cell in excel which changes from TRUE to FALSE when clicked on
and vice versa. Is this possible?

dhstein

How do I insert a cell which changes value when clicked on
 
No it isn't possible. You can do something close.

1) Create a button which executes VBA code. The code will check the value
of a cell for example "C1" and if the contents are "False" put a value of
"True there and vice versa.


"JohnRScott" wrote:

I wnt to have cell in excel which changes from TRUE to FALSE when clicked on
and vice versa. Is this possible?


Chris Bode

1.Right click on the toolbar, from the popup select control box.
2.Select a command button from the control box on your sheet
3.Double click on the command button to open the code window and paste following codes
Code:

Private Sub CommandButton1_Click()
    Sheet1.Range("A1").Value = Not CBool(Sheet1.Range("A1").Value)
End Sub



Chris
------
Convert your Excel spreadsheet into an online calculator.
http://www.spreadsheetconverter.com


All times are GMT +1. The time now is 08:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com