Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
lmv lmv is offline
external usenet poster
 
Posts: 9
Default IF completed THEN invisible

I don't know if this needs to be VBA condition a macro or a conditional
format on the cell or ?? I don't know how to format what I want to do.

If the word "completed" is in cell E5 (actually in the E Column)
Then then date in the corresponding row C cell is invisible or text is white
so it won't show)
I already have 3 conditional formats in these columns
=$E$5="Overdue" RED
=$E$5="Pending" Orange
=$E$5="Completed" Green
=====================================

=AND(C4-TODAY()=15,C4-TODAY()<=30) Yellow Back
=AND(C4-TODAY()=2,C4-TODAY()<=14) Orange Back
=AND(C4-TODAY()<=1) RED
======================================

Please help me write the format... Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 42
Default IF completed THEN invisible

Imv

Right-click on the sheet tab and choose Viewcode. Copy this code into the VB
editor
It turns the dates white when column E shows completed

Sub worksheet_Change(ByVal target As Range)
Set target = Range("E5:E200")
For Each c In target
If UCase(c) = "COMPLETED" Then
c.Offset(0, -2).Font.ColorIndex = 2
End If
Next
End Sub

Regards
Peter

"lmv" wrote:

I don't know if this needs to be VBA condition a macro or a conditional
format on the cell or ?? I don't know how to format what I want to do.

If the word "completed" is in cell E5 (actually in the E Column)
Then then date in the corresponding row C cell is invisible or text is white
so it won't show)
I already have 3 conditional formats in these columns
=$E$5="Overdue" RED
=$E$5="Pending" Orange
=$E$5="Completed" Green
=====================================

=AND(C4-TODAY()=15,C4-TODAY()<=30) Yellow Back
=AND(C4-TODAY()=2,C4-TODAY()<=14) Orange Back
=AND(C4-TODAY()<=1) RED
======================================

Please help me write the format... Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
lmv lmv is offline
external usenet poster
 
Posts: 9
Default IF completed THEN invisible

Thanks, but I get compile errors on line

For Each c In target


Also, would you mind defining what the code means with comments?
c.Offset(0, -2).Font.ColorIndex = 2

Does this mean that it is going to look at the column -2 which would be C
and change the font to white?

Thanks


"PeterAtherton" wrote:

Imv

Right-click on the sheet tab and choose Viewcode. Copy this code into the VB
editor
It turns the dates white when column E shows completed

Sub worksheet_Change(ByVal target As Range)
Set target = Range("E5:E200")
For Each c In target
If UCase(c) = "COMPLETED" Then
c.Offset(0, -2).Font.ColorIndex = 2
End If
Next
End Sub

Regards
Peter

"lmv" wrote:

I don't know if this needs to be VBA condition a macro or a conditional
format on the cell or ?? I don't know how to format what I want to do.

If the word "completed" is in cell E5 (actually in the E Column)
Then then date in the corresponding row C cell is invisible or text is white
so it won't show)
I already have 3 conditional formats in these columns
=$E$5="Overdue" RED
=$E$5="Pending" Orange
=$E$5="Completed" Green
=====================================

=AND(C4-TODAY()=15,C4-TODAY()<=30) Yellow Back
=AND(C4-TODAY()=2,C4-TODAY()<=14) Orange Back
=AND(C4-TODAY()<=1) RED
======================================

Please help me write the format... Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default IF completed THEN invisible

Maybe you have to declare it

Sub worksheet_Change(ByVal target As Range)
Dim c As Range
Set target = Range("E5:E200")
For Each c In target
If UCase(c) = "COMPLETED" Then
c.Offset(0, -2).Font.ColorIndex = 2
End If
Next
End Sub

I allows for multiple cells, that is why it iterates through each c (c bing
a single cell) in the target, but only if they are within E5:E200, and if c
is the string required, it changes the cell 2 columns to the left to white.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"lmv" wrote in message
...
Thanks, but I get compile errors on line

For Each c In target


Also, would you mind defining what the code means with comments?
c.Offset(0, -2).Font.ColorIndex = 2

Does this mean that it is going to look at the column -2 which would be C
and change the font to white?

Thanks


"PeterAtherton" wrote:

Imv

Right-click on the sheet tab and choose Viewcode. Copy this code into

the VB
editor
It turns the dates white when column E shows completed

Sub worksheet_Change(ByVal target As Range)
Set target = Range("E5:E200")
For Each c In target
If UCase(c) = "COMPLETED" Then
c.Offset(0, -2).Font.ColorIndex = 2
End If
Next
End Sub

Regards
Peter

"lmv" wrote:

I don't know if this needs to be VBA condition a macro or a

conditional
format on the cell or ?? I don't know how to format what I want to do.

If the word "completed" is in cell E5 (actually in the E Column)
Then then date in the corresponding row C cell is invisible or text is

white
so it won't show)
I already have 3 conditional formats in these columns
=$E$5="Overdue" RED
=$E$5="Pending" Orange
=$E$5="Completed" Green
=====================================

=AND(C4-TODAY()=15,C4-TODAY()<=30) Yellow Back
=AND(C4-TODAY()=2,C4-TODAY()<=14) Orange Back
=AND(C4-TODAY()<=1) RED
======================================

Please help me write the format... Thanks!



  #5   Report Post  
Posted to microsoft.public.excel.misc
lmv lmv is offline
external usenet poster
 
Posts: 9
Default IF completed THEN invisible

Thank you for the help ... this is working partially but because I already
have conditional formatting in these date cells (C) the background is red
when it is overdue and when it is changed in (E) to "completed" this formula
will not change the background. I don't know how to set the conditional
formatting to false before I impliment the formula given. Another glitch I
am finding if I use a drop down in E and "pending", "overdue", "not started"
should all display but if I make the mistake of going to "completed" it
changes the font to white but doesn't change/ revert back to black when I go
to the other options. Once again I don't know how to write it...

I have tried interior.colorindex =2 but it didn't work.

I tried:
If UCase(c) = "COMPLETED" Then
c.Offset(0, -2).Font.ColorIndex = 2
End If

If UCase(c) = "Pending" Then
c.Offset(0, -2).Font.ColorIndex = 1
End If

If UCase(c) = "Overdue" Then
c.Offset(0, -2).Font.ColorIndex = 1
End If

Next

Won't work either... any other steps I can try...?
Thanks!

"Bob Phillips" wrote:

Maybe you have to declare it

Sub worksheet_Change(ByVal target As Range)
Dim c As Range
Set target = Range("E5:E200")
For Each c In target
If UCase(c) = "COMPLETED" Then
c.Offset(0, -2).Font.ColorIndex = 2
End If
Next
End Sub

I allows for multiple cells, that is why it iterates through each c (c bing
a single cell) in the target, but only if they are within E5:E200, and if c
is the string required, it changes the cell 2 columns to the left to white.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"lmv" wrote in message
...
Thanks, but I get compile errors on line

For Each c In target


Also, would you mind defining what the code means with comments?
c.Offset(0, -2).Font.ColorIndex = 2

Does this mean that it is going to look at the column -2 which would be C
and change the font to white?

Thanks


"PeterAtherton" wrote:

Imv

Right-click on the sheet tab and choose Viewcode. Copy this code into

the VB
editor
It turns the dates white when column E shows completed

Sub worksheet_Change(ByVal target As Range)
Set target = Range("E5:E200")
For Each c In target
If UCase(c) = "COMPLETED" Then
c.Offset(0, -2).Font.ColorIndex = 2
End If
Next
End Sub

Regards
Peter

"lmv" wrote:

I don't know if this needs to be VBA condition a macro or a

conditional
format on the cell or ?? I don't know how to format what I want to do.

If the word "completed" is in cell E5 (actually in the E Column)
Then then date in the corresponding row C cell is invisible or text is

white
so it won't show)
I already have 3 conditional formats in these columns
=$E$5="Overdue" RED
=$E$5="Pending" Orange
=$E$5="Completed" Green
=====================================

=AND(C4-TODAY()=15,C4-TODAY()<=30) Yellow Back
=AND(C4-TODAY()=2,C4-TODAY()<=14) Orange Back
=AND(C4-TODAY()<=1) RED
======================================

Please help me write the format... Thanks!






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default IF completed THEN invisible

I have been re-reading this thread and I am wondering why Peter suggested
code in the first place. Although you want to add more actions, it is to a
condition that already is tested for. In other words,. why don't you just
change the CF for Completed to set the font colour to green as well as the
cell colour?

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"lmv" wrote in message
...
Thank you for the help ... this is working partially but because I already
have conditional formatting in these date cells (C) the background is red
when it is overdue and when it is changed in (E) to "completed" this

formula
will not change the background. I don't know how to set the conditional
formatting to false before I impliment the formula given. Another glitch

I
am finding if I use a drop down in E and "pending", "overdue", "not

started"
should all display but if I make the mistake of going to "completed" it
changes the font to white but doesn't change/ revert back to black when I

go
to the other options. Once again I don't know how to write it...

I have tried interior.colorindex =2 but it didn't work.

I tried:
If UCase(c) = "COMPLETED" Then
c.Offset(0, -2).Font.ColorIndex = 2
End If

If UCase(c) = "Pending" Then
c.Offset(0, -2).Font.ColorIndex = 1
End If

If UCase(c) = "Overdue" Then
c.Offset(0, -2).Font.ColorIndex = 1
End If

Next

Won't work either... any other steps I can try...?
Thanks!

"Bob Phillips" wrote:

Maybe you have to declare it

Sub worksheet_Change(ByVal target As Range)
Dim c As Range
Set target = Range("E5:E200")
For Each c In target
If UCase(c) = "COMPLETED" Then
c.Offset(0, -2).Font.ColorIndex = 2
End If
Next
End Sub

I allows for multiple cells, that is why it iterates through each c (c

bing
a single cell) in the target, but only if they are within E5:E200, and

if c
is the string required, it changes the cell 2 columns to the left to

white.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"lmv" wrote in message
...
Thanks, but I get compile errors on line

For Each c In target

Also, would you mind defining what the code means with comments?
c.Offset(0, -2).Font.ColorIndex = 2
Does this mean that it is going to look at the column -2 which would

be C
and change the font to white?

Thanks


"PeterAtherton" wrote:

Imv

Right-click on the sheet tab and choose Viewcode. Copy this code

into
the VB
editor
It turns the dates white when column E shows completed

Sub worksheet_Change(ByVal target As Range)
Set target = Range("E5:E200")
For Each c In target
If UCase(c) = "COMPLETED" Then
c.Offset(0, -2).Font.ColorIndex = 2
End If
Next
End Sub

Regards
Peter

"lmv" wrote:

I don't know if this needs to be VBA condition a macro or a

conditional
format on the cell or ?? I don't know how to format what I want to

do.

If the word "completed" is in cell E5 (actually in the E Column)
Then then date in the corresponding row C cell is invisible or

text is
white
so it won't show)
I already have 3 conditional formats in these columns
=$E$5="Overdue" RED
=$E$5="Pending" Orange
=$E$5="Completed" Green
=====================================

=AND(C4-TODAY()=15,C4-TODAY()<=30) Yellow Back
=AND(C4-TODAY()=2,C4-TODAY()<=14) Orange Back
=AND(C4-TODAY()<=1) RED
======================================

Please help me write the format... 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
Force a field to be completed kellyhilde Excel Worksheet Functions 0 August 17th 06 02:06 PM
change invisible bars back to visible hf Charts and Charting in Excel 1 July 28th 06 02:29 PM
Number of tasks completed in a specific time frame Robert Excel Discussion (Misc queries) 2 February 3rd 06 01:25 PM
excel document is invisible keysey Excel Discussion (Misc queries) 2 December 13th 05 08:05 AM
Why are Excel 2003 chart arrows and lines invisible with little c. Len Charts and Charting in Excel 1 April 1st 05 03:09 PM


All times are GMT +1. The time now is 11:45 PM.

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"