Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default Conditional Formatting

Hi Group,
I am trying to format a column's "number" format using CF, but I can't
get the formatting to change. The CF that I have been trying (in Excel
2007 BTW) is:
=Range("P")="ValueA", with the formatting applying to $Q$2:$Q$65000. I
selected one of the Date formats to apply if the condition is true,
but it doesn't work. I can do it easily with VBA
Worksheet_SelectionChange like this, but it kills the "undo" and the
fill handle:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim Value As String
Dim r As Long
r = ActiveCell.Row
With Target
With ActiveCell

'If Row P value is "ValueA", or "ValueB then
'format of Row Q accepts date, otherwise cell format will be "General"
If Cells(r, "P").Value = "ValueA" Or Cells(r, "P").Value = "ValueB"
Then
Cells(r, "Q").NumberFormat = "m/d/yy;@"

ElseIf Cells(r, "P") < "ValueA" Or Cells(r, "P").Value < "ValueB"
Then
Cells(r, "Q").NumberFormat = ""


End If
End With
End With
End Sub

I am just trying to preserve the "undo" and fill handle options. Any
suggestions will be greatly appreciated!
Ken

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Conditional Formatting

On Sun, 18 Jan 2009 19:36:07 +0530, Ken wrote:

Hi Group,
I am trying to format a column's "number" format using CF, but I can't
get the formatting to change. The CF that I have been trying (in Excel
2007 BTW) is:
=Range("P")="ValueA", with the formatting applying to $Q$2:$Q$65000. I
selected one of the Date formats to apply if the condition is true,
but it doesn't work. I can do it easily with VBA
Worksheet_SelectionChange like this, but it kills the "undo" and the
fill handle:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim Value As String
Dim r As Long
r = ActiveCell.Row
With Target
With ActiveCell

'If Row P value is "ValueA", or "ValueB then
'format of Row Q accepts date, otherwise cell format will be "General"
If Cells(r, "P").Value = "ValueA" Or Cells(r, "P").Value = "ValueB"
Then
Cells(r, "Q").NumberFormat = "m/d/yy;@"

ElseIf Cells(r, "P") < "ValueA" Or Cells(r, "P").Value < "ValueB"
Then
Cells(r, "Q").NumberFormat = ""


End If
End With
End With
End Sub

I am just trying to preserve the "undo" and fill handle options. Any
suggestions will be greatly appreciated!
Ken


Hi

Try this

Select $Q$2:$Q$65000

In the "Formula to use box" use this : =OR($P2="ValueA",$P2="ValueB")
Set the Format ("m/d/yy;@")

Hope this helps

--
Thanks,
Victor

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default Conditional Formatting

Thanks, Victor....I think that's going work....I haven't fully tested
it yet (just adding a couple more conditions)....again, thanks so much
for your help!
Ken
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
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 3 January 20th 07 02:02 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 0 January 15th 07 04:35 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


All times are GMT +1. The time now is 04:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"