Re: $$Excel-Macros$$ Toggle a Cell value

2011-10-17 Thread Cab Boose
*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

Re: $$Excel-Macros$$ Toggle a Cell value

2011-10-16 Thread Cab Boose
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

Re: $$Excel-Macros$$ Toggle a Cell value

2011-10-16 Thread Sam Mathai Chacko
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

Re: $$Excel-Macros$$ Toggle a Cell value

2011-10-15 Thread dguillett1
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

Re: $$Excel-Macros$$ Toggle a Cell value

2011-10-14 Thread dguillett1
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

Re: $$Excel-Macros$$ Toggle a Cell value

2011-10-14 Thread Sam Mathai Chacko
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

Re: $$Excel-Macros$$ Toggle a Cell value

2011-10-14 Thread Cab Boose
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

Re: $$Excel-Macros$$ Toggle a Cell value

2011-10-14 Thread Sam Mathai Chacko
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