Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Color changes On Input even if new input matches default
Cell Color changes On Input even if new input matches default...
I have a Macro Button which sets a Range of Cells to this default: (example) Sub SetDefaultCells() Range("B10").Value = "8:30 AM" Range("B10").Interior.Color = vbYellow End Sub How can I place a code into this cell so that when the user changes the time it changes the cell color? My problem is that the user may need to keep it at 8:30 AM, so can I change the cell color even if the user inputs the same data if they key in the same data as the default? This is why I can not use conditional formatting. I can't use onActive Cell either because when the user hits Enter it will go to the next cell and if I use onClick the user may not use the click function. Any help is greatly appreciated. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell Color changes On Input even if new input matches default
Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the right blank portion. Get back to to workbook and try out. Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Target, Range("B10")) Is Nothing Then _ Range("B10").Interior.ColorIndex = xlNone End Sub If this post helps click Yes --------------- Jacob Skaria "JBark" wrote: Cell Color changes On Input even if new input matches default... I have a Macro Button which sets a Range of Cells to this default: (example) Sub SetDefaultCells() Range("B10").Value = "8:30 AM" Range("B10").Interior.Color = vbYellow End Sub How can I place a code into this cell so that when the user changes the time it changes the cell color? My problem is that the user may need to keep it at 8:30 AM, so can I change the cell color even if the user inputs the same data if they key in the same data as the default? This is why I can not use conditional formatting. I can't use onActive Cell either because when the user hits Enter it will go to the next cell and if I use onClick the user may not use the click function. Any help is greatly appreciated. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to input pictures automatically based on cell input? | Excel Worksheet Functions | |||
default name and value in input cell | Excel Worksheet Functions | |||
Have user input converted to uppercase in same cell as input? | New Users to Excel | |||
color/shade cell upon input | Excel Discussion (Misc queries) | |||
VBA: Look-Up Cell Date From User Input Box and return ALL matches | Excel Programming |