PC Review


Reply
Thread Tools Rate Thread

Activate data according to the value key in in other cell.

 
 
khollam.sagar@gmail.com
Guest
Posts: n/a
 
      4th May 2008
Hi

I need to activate data according to the value key in in other cell.
eg:

If Then
A 1 2
B 1 3
C 2 3
D 1 2 3

if the value is A then 1 and 2 should be highlighted
and if B then 1 and 3,
if C then 2 and 3
and if D then 1,2 and 3 should be highlighted or viewed
 
Reply With Quote
 
 
 
 
Ken Johnson
Guest
Posts: n/a
 
      4th May 2008
On May 4, 6:14 pm, "khollam.sa...@gmail.com" <khollam.sa...@gmail.com>
wrote:
> Hi
>
> I need to activate data according to the value key in in other cell.
> eg:
>
> If Then
> A 1 2
> B 1 3
> C 2 3
> D 1 2 3
>
> if the value is A then 1 and 2 should be highlighted
> and if B then 1 and 3,
> if C then 2 and 3
> and if D then 1,2 and 3 should be highlighted or viewed


Maybe Conditional Formatting??

Say A,B,C or D can be in $A$1, 1 in $B$1, 2 in $C$1 and 3 in $D$1
Then, after selecting $B$1, go Format|Conditional formatting to bring
up the Conditional formatting dialog. Select Formula Is then use this
formula...

=$A1="C"

Then Format the font to be the same color as the cell background color
(most likely white) then click OK.

Repeat for cell $C$1 using this formula...

=$A1="B"

Repeat for cell $D$1 using this formula...

=$A1="A"

With this formatting in place; when $A$1 = A, only the 1 in $B$1 and
the 2 in $C$1 will be visible; when $A$1 = "B", only the 1 in $B$1 and
the 3 in $D$1 will be vissible, when $A$1 = C, only the 2 in $C$1 and
the 3 in $D$1 will be visible; when $A$1 = D the 1 in $B$1, the 2 in $C
$1 and the 3 in $D$1 will all be visible.

Ken Johnson
 
Reply With Quote
 
Geoff
Guest
Posts: n/a
 
      4th May 2008
You may also want to consider:

hth

Geoff

Sub HighLightCells()

Dim tbl As Range, tbl2 As Range, rng As Range, rng2 As Range
Dim found As Range, found2 As Range

'''set search range in col A
Set tbl = Range("A1:A" & Range("A65536").End(xlUp).Row)

For Each rng In tbl
'''find row in col A
Set found = tbl.Find(rng.Value, , xlValues, xlWhole, xlNext, xlByRows)
If Not found Is Nothing Then
Set tbl2 = Range(Cells(found.Row, 2), Cells(found.Row, 4))
For Each rng2 In tbl2
If Not IsEmpty(rng2) And rng2.Value > 0 Then
Select Case rng.Value
Case "A"
'''rng2.Font.Color = vbRed '''*****use this
rng2.Interior.Color = vbRed '''*****or this
Case "B"
'''rng2.Font.Color = vbBlue
rng2.Interior.Color = vbCyan
Case "C"
'''rng2.Font.Color = vbGreen
rng2.Interior.Color = vbGreen
Case "D"
'''rng2.Font.Color = vbMagenta
rng2.Interior.Color = vbMagenta
Case Else
End Select
End If
Next
End If
Next

End Sub

"(E-Mail Removed)" wrote:

> Hi
>
> I need to activate data according to the value key in in other cell.
> eg:
>
> If Then
> A 1 2
> B 1 3
> C 2 3
> D 1 2 3
>
> if the value is A then 1 and 2 should be highlighted
> and if B then 1 and 3,
> if C then 2 and 3
> and if D then 1,2 and 3 should be highlighted or viewed
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
activate cell varun Microsoft Excel Worksheet Functions 1 5th Feb 2009 08:18 AM
how to activate a cell if it contains data Joe Microsoft Excel New Users 1 5th Dec 2007 04:40 PM
Event Macro - On Cell Activate - Change Cell Format Bob@1800-mail.com Microsoft Excel Programming 7 7th Nov 2007 03:36 AM
"Hot spot" in a spreadsheet that will duplicate the cell's entry to another cell, or to activate a macro jayray Microsoft Excel Programming 2 1st Sep 2007 02:42 PM
Activate Cell =?Utf-8?B?QnJldHQ=?= Microsoft Excel Misc 2 29th Mar 2005 06:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:03 PM.