*To:* excel-macros@googlegroups.com
*Subject:* Re: $$Excel-Macros$$ Toggle a Cell value
Hi Don and Sam
Thanks for your input.
I use Win7 Excel and on a laptop.
Don, your code work ok but small hiccup. The code/color changes ok when
I select a different cell and then come back to actual
SalesAid Software
dguille...@gmail.com
*From:* Cab Boose swch...@gmail.com
*Sent:* Friday, October 14, 2011 8:32 PM
*To:* excel-macros@googlegroups.com
*Subject:* Re: $$Excel-Macros$$ Toggle a Cell value
Hi Don and Sam
Thanks for your input.
I use Win7 Excel and on a laptop.
Don
SalesAid Software
dguille...@gmail.com
*From:* Cab Boose swch...@gmail.com
*Sent:* Friday, October 14, 2011 8:32 PM
*To:* excel-macros@googlegroups.com
*Subject:* Re: $$Excel-Macros$$ Toggle a Cell value
Hi Don and Sam
Thanks for your input.
I use Win7 Excel and on a laptop.
Don, your
Your request was “when I SELECT the cell”. So, as Sam says, use another event
such as doubleclick.
Don Guillett
SalesAid Software
dguille...@gmail.com
From: Cab Boose
Sent: Friday, October 14, 2011 8:32 PM
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ Toggle a Cell value
Hi
Right click sheet tabview codecopy/paste this to make the changes in col G
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column 7 Or Target.Count 1 Then Exit Sub
If Target = 1 Then
Target = 0
Target.Interior.ColorIndex = 4
Else
Target = 1
Target.Interior.ColorIndex = 3
This should do it
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address(0, 0) = G15 Then
Target.Value = Abs(CLng(Not -Target.Value))
End If
End Sub
Use a conditional format for coloring the cell.
If you do not want to add a conditional format (which is
Hi Don and Sam
Thanks for your input.
I use Win7 Excel and on a laptop.
Don, your code work ok but small hiccup. The code/color changes ok when I
select a different cell and then come back to actual cell again. Color and
number change as required. However I would like to be able to leave
Charlie, the reason why it throws an exception is because the cell should
have either 1 or 0 in the first place. You probably are copying the formula
over to your workbook. If yes, just put a 0 in G15 before you start using
the macro.
FOr your query regarding selection of cell, pls download the