Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Make a Yes/no cell using a single click


I am using Excell 2007.
I am making a spreadsheet that is going to be used by a number of people. I
would like some of the cells to change colour when clicked on, without having
to enter any data, e.g. if the heading is 'native', the user would be able
to click on cells in the column and the cell would change colour to indicate
a 'yes' answer. If the same cell was then changed later to 'no' it could be
clicked on to return to the original colour.
I can change the colour if I enter a Y using conditional formatting, but
don't know how to change it if the cell is just clicked on.
Can you help please?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Make a Yes/no cell using a single click

Try this event sub:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Interior.ColorIndex = 3 Then
Target.Interior.ColorIndex = 0
Else
Target.Interior.ColorIndex = 3
End If
End Sub

Post if you need help to install it!

Regards,
Stefi


€˛julene€¯ ezt Ć*rta:


I am using Excell 2007.
I am making a spreadsheet that is going to be used by a number of people. I
would like some of the cells to change colour when clicked on, without having
to enter any data, e.g. if the heading is 'native', the user would be able
to click on cells in the column and the cell would change colour to indicate
a 'yes' answer. If the same cell was then changed later to 'no' it could be
clicked on to return to the original colour.
I can change the colour if I enter a Y using conditional formatting, but
don't know how to change it if the cell is just clicked on.
Can you help please?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Make a Yes/no cell using a single click

Thanks Stefi. I need help.
Thanks again
Julie

"Stefi" wrote:

Try this event sub:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Interior.ColorIndex = 3 Then
Target.Interior.ColorIndex = 0
Else
Target.Interior.ColorIndex = 3
End If
End Sub

Post if you need help to install it!

Regards,
Stefi


€˛julene€¯ ezt Ć*rta:


I am using Excell 2007.
I am making a spreadsheet that is going to be used by a number of people. I
would like some of the cells to change colour when clicked on, without having
to enter any data, e.g. if the heading is 'native', the user would be able
to click on cells in the column and the cell would change colour to indicate
a 'yes' answer. If the same cell was then changed later to 'no' it could be
clicked on to return to the original colour.
I can change the colour if I enter a Y using conditional formatting, but
don't know how to change it if the cell is just clicked on.
Can you help please?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Make a Yes/no cell using a single click

This shorter routine will do the same thing your code does...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Interior.ColorIndex = 3 - Target.Interior.ColorIndex
End Sub

--
Rick (MVP - Excel)


"Stefi" wrote in message
...
Try this event sub:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Interior.ColorIndex = 3 Then
Target.Interior.ColorIndex = 0
Else
Target.Interior.ColorIndex = 3
End If
End Sub

Post if you need help to install it!

Regards,
Stefi


€˛julene€¯ ezt Ć*rta:


I am using Excell 2007.
I am making a spreadsheet that is going to be used by a number of people.
I
would like some of the cells to change colour when clicked on, without
having
to enter any data, e.g. if the heading is 'native', the user would be
able
to click on cells in the column and the cell would change colour to
indicate
a 'yes' answer. If the same cell was then changed later to 'no' it could
be
clicked on to return to the original colour.
I can change the colour if I enter a Y using conditional formatting, but
don't know how to change it if the cell is just clicked on.
Can you help please?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Make a Yes/no cell using a single click

Rick, it's nice and tricky!

Julene,

Open VBA (Alt+F11)
Right click on your worksheet name in the Project window
Select View code from the local menu
Copy and paste Rick's macro in the code window

Regards,
Stefi


€˛Rick Rothstein€¯ ezt Ć*rta:

This shorter routine will do the same thing your code does...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Interior.ColorIndex = 3 - Target.Interior.ColorIndex
End Sub

--
Rick (MVP - Excel)


"Stefi" wrote in message
...
Try this event sub:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Interior.ColorIndex = 3 Then
Target.Interior.ColorIndex = 0
Else
Target.Interior.ColorIndex = 3
End If
End Sub

Post if you need help to install it!

Regards,
Stefi


€˛julene€¯ ezt Ć*rta:


I am using Excell 2007.
I am making a spreadsheet that is going to be used by a number of people.
I
would like some of the cells to change colour when clicked on, without
having
to enter any data, e.g. if the heading is 'native', the user would be
able
to click on cells in the column and the cell would change colour to
indicate
a 'yes' answer. If the same cell was then changed later to 'no' it could
be
clicked on to return to the original colour.
I can change the colour if I enter a Y using conditional formatting, but
don't know how to change it if the cell is just clicked on.
Can you help please?





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Make a Yes/no cell using a single click

For future reference, you can make a single line toggle between any two
values. Here is the general format of such a statement...

Variable = (Value1 + Value2) - Variable

So, if the values to be toggled between are 3 and 7, then the statement
becomes...

Variable = 10 - Variable

Of course, Variable must be first set to one or the other of Value1.
Assuming it is 3, then 10 - 3 gives 7; and if it is 7, then 10 - 7 is 3.

--
Rick (MVP - Excel)


"Stefi" wrote in message
...
Rick, it's nice and tricky!

Julene,

Open VBA (Alt+F11)
Right click on your worksheet name in the Project window
Select View code from the local menu
Copy and paste Rick's macro in the code window

Regards,
Stefi


€˛Rick Rothstein€¯ ezt Ć*rta:

This shorter routine will do the same thing your code does...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Interior.ColorIndex = 3 - Target.Interior.ColorIndex
End Sub

--
Rick (MVP - Excel)


"Stefi" wrote in message
...
Try this event sub:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Interior.ColorIndex = 3 Then
Target.Interior.ColorIndex = 0
Else
Target.Interior.ColorIndex = 3
End If
End Sub

Post if you need help to install it!

Regards,
Stefi


€˛julene€¯ ezt Ć*rta:


I am using Excell 2007.
I am making a spreadsheet that is going to be used by a number of
people.
I
would like some of the cells to change colour when clicked on, without
having
to enter any data, e.g. if the heading is 'native', the user would be
able
to click on cells in the column and the cell would change colour to
indicate
a 'yes' answer. If the same cell was then changed later to 'no' it
could
be
clicked on to return to the original colour.
I can change the colour if I enter a Y using conditional formatting,
but
don't know how to change it if the cell is just clicked on.
Can you help please?




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Make a Yes/no cell using a single click

Thanks, Rick, how simple it is after someone invented it!
Stefi


€˛Rick Rothstein€¯ ezt Ć*rta:

For future reference, you can make a single line toggle between any two
values. Here is the general format of such a statement...

Variable = (Value1 + Value2) - Variable

So, if the values to be toggled between are 3 and 7, then the statement
becomes...

Variable = 10 - Variable

Of course, Variable must be first set to one or the other of Value1.
Assuming it is 3, then 10 - 3 gives 7; and if it is 7, then 10 - 7 is 3.

--
Rick (MVP - Excel)


"Stefi" wrote in message
...
Rick, it's nice and tricky!

Julene,

Open VBA (Alt+F11)
Right click on your worksheet name in the Project window
Select View code from the local menu
Copy and paste Rick's macro in the code window

Regards,
Stefi


€˛Rick Rothstein€¯ ezt Ć*rta:

This shorter routine will do the same thing your code does...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Interior.ColorIndex = 3 - Target.Interior.ColorIndex
End Sub

--
Rick (MVP - Excel)


"Stefi" wrote in message
...
Try this event sub:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Interior.ColorIndex = 3 Then
Target.Interior.ColorIndex = 0
Else
Target.Interior.ColorIndex = 3
End If
End Sub

Post if you need help to install it!

Regards,
Stefi


€˛julene€¯ ezt Ć*rta:


I am using Excell 2007.
I am making a spreadsheet that is going to be used by a number of
people.
I
would like some of the cells to change colour when clicked on, without
having
to enter any data, e.g. if the heading is 'native', the user would be
able
to click on cells in the column and the cell would change colour to
indicate
a 'yes' answer. If the same cell was then changed later to 'no' it
could
be
clicked on to return to the original colour.
I can change the colour if I enter a Y using conditional formatting,
but
don't know how to change it if the cell is just clicked on.
Can you help please?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Click on single cell, multiple cells are selected. WDW Excel Discussion (Misc queries) 17 May 30th 08 10:57 PM
Excell is not allowing me to click onto a single cell. WHY? typeover Excel Worksheet Functions 1 May 20th 08 07:59 PM
Changing row content with single cell click aussiemike Excel Discussion (Misc queries) 2 May 25th 06 06:37 AM
How do i insert a image to a single cell then click on the cell & Geek Setting up and Configuration of Excel 1 April 28th 06 03:46 AM
IN EXCEL, WHEN I CLICK ONA SINGLE CELL It HIGHLIGHTS WHOLE Page confused Excel Discussion (Misc queries) 2 December 7th 04 09:41 PM


All times are GMT +1. The time now is 06:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"