Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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
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
How to input pictures automatically based on cell input? bsharp Excel Worksheet Functions 9 May 30th 09 07:16 AM
default name and value in input cell [email protected] Excel Worksheet Functions 4 November 13th 06 04:42 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
color/shade cell upon input MarkT Excel Discussion (Misc queries) 5 November 5th 05 02:22 PM
VBA: Look-Up Cell Date From User Input Box and return ALL matches Mcasteel[_38_] Excel Programming 1 November 11th 04 03:34 AM


All times are GMT +1. The time now is 10:36 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"