Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
PJ
 
Posts: n/a
Default Conditional format problem

I have a column of data in an excel spreadsheet that uses the "workday"
function to create a cell value that shows a date. when you manually input a
date in one of the cells, all of the cells below auto adjust to the new dates
based on the "workday" formula. what I want to do is when a date is manually
input into one of the cells that has the workday formula in it, I want the
cell to change color if the new date is before or after the date that was
originally in this cell with the formula. when I try to input the conditional
format, I am getting an error message that I cannot refer to other worksheets
or workbooks, but all of the information is only on 1 worksheet and the
formula in the conditional format refers to that same worksheet.
please help as my Brain has frozen.
thanks.
Phil.
  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

Another way

Private PrevValue

Private Sub Worksheet_Activate()
PrevValue = ActiveCell.Value
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("H1:H10")) Is Nothing Then
With Target
If .Value < PrevValue Then
.Interior.ColorIndex = 3
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
PrevValue = Target.Value
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Don Guillett" wrote in message
...
You could do this with a dummy duplicate and hidden colunmn to the right

and
this worksheet change event.
Right click sheet tabview codeinsert thismodify to suitSAVE

Private Sub Worksheet_change(ByVal Target As Range)
If Target.Row < 2 Or Target.Column < 3 Then Exit Sub
If Target < Target.Offset(, 1) Then Target.Interior.ColorIndex = 4
End Sub

--
Don Guillett
SalesAid Software

"PJ" wrote in message
...
I have a column of data in an excel spreadsheet that uses the "workday"
function to create a cell value that shows a date. when you manually

input
a
date in one of the cells, all of the cells below auto adjust to the new

dates
based on the "workday" formula. what I want to do is when a date is

manually
input into one of the cells that has the workday formula in it, I want

the
cell to change color if the new date is before or after the date that

was
originally in this cell with the formula. when I try to input the

conditional
format, I am getting an error message that I cannot refer to other

worksheets
or workbooks, but all of the information is only on 1 worksheet and the
formula in the conditional format refers to that same worksheet.
please help as my Brain has frozen.
thanks.
Phil.





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
Format Painter button problem Skip Bisconer Excel Discussion (Misc queries) 3 December 24th 04 06:05 PM
Problem with Conditional format deletion [email protected] Excel Discussion (Misc queries) 3 December 13th 04 05:10 PM
copy conditional format as ACTUAL format Dana Zulager Excel Discussion (Misc queries) 7 December 7th 04 11:02 PM
Copying a conditional format Meaux Excel Worksheet Functions 2 November 29th 04 10:19 AM
help please with conditional format problem Graham Warren Excel Worksheet Functions 1 November 7th 04 05:57 PM


All times are GMT +1. The time now is 03:13 AM.

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"