Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default red Color for same value cells

Hi from italy,
sorry if question was already posted but i dont'find anithing on goole :
I have a column H1:H:32, example :

h1 Alfa
h2 Beta
h3 Omega
h4 Beta
h5 Omega
h6 Alfa
h7 P
h8 Alfa
h9 P
h10 ecc

when I click on cell taht contain "Alfa" , i want all "alfa" cell become red
if i click on cell that contain "Beta" , all "Beta" cell become red


TIA








--
-------------------------------------------------------------
se vuoi scrivermi sostituisci tiscali con yahoo
ciao


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default red Color for same value cells

Hi from the UK,

here is one way

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
If Not Intersect(Target, Range("H1:H:32")) Is Nothing Then
Range("B1:B100").FormatConditions.Delete
For Each cell In Range("H1:H:32")
cell.FormatConditions.Add Type:=xlExpression, _
Formula1:="=" & cell.Address & "=" & Target.Address
cell.FormatConditions(1).Interior.ColorIndex = 3
Next cell
End If

End Sub

it is worksheet event code, so right-click on the sheet tab, select View
Code from the menu, and paste the code in

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Aristotele64" wrote in message
...
Hi from italy,
sorry if question was already posted but i dont'find anithing on goole :
I have a column H1:H:32, example :

h1 Alfa
h2 Beta
h3 Omega
h4 Beta
h5 Omega
h6 Alfa
h7 P
h8 Alfa
h9 P
h10 ecc

when I click on cell taht contain "Alfa" , i want all "alfa" cell become

red
if i click on cell that contain "Beta" , all "Beta" cell become red


TIA








--
-------------------------------------------------------------
se vuoi scrivermi sostituisci tiscali con yahoo
ciao




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default red Color for same value cells

Hi
though this is possible (using the Selection_change event) this is not
that easy. It would be easier if you could enter the value in a
separate cell and use conditional format for this

--
Regards
Frank Kabel
Frankfurt, Germany


Aristotele64 wrote:
Hi from italy,
sorry if question was already posted but i dont'find anithing on
goole :
I have a column H1:H:32, example :

h1 Alfa
h2 Beta
h3 Omega
h4 Beta
h5 Omega
h6 Alfa
h7 P
h8 Alfa
h9 P
h10 ecc

when I click on cell taht contain "Alfa" , i want all "alfa" cell
become red if i click on cell that contain "Beta" , all "Beta" cell
become red


TIA


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default red Color for same value cells

Frank,

See my answer.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Frank Kabel" wrote in message
...
Hi
though this is possible (using the Selection_change event) this is not
that easy. It would be easier if you could enter the value in a
separate cell and use conditional format for this

--
Regards
Frank Kabel
Frankfurt, Germany


Aristotele64 wrote:
Hi from italy,
sorry if question was already posted but i dont'find anithing on
goole :
I have a column H1:H:32, example :

h1 Alfa
h2 Beta
h3 Omega
h4 Beta
h5 Omega
h6 Alfa
h7 P
h8 Alfa
h9 P
h10 ecc

when I click on cell taht contain "Alfa" , i want all "alfa" cell
become red if i click on cell that contain "Beta" , all "Beta" cell
become red


TIA




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default red Color for same value cells

Many tkanks !!!!
It's working beatiful !!!!
I change only :

Range("B1:B100").FormatConditions.Delete

in
Range("H2:H32").FormatConditions.Delete


right ?

by and good evining !!



"Bob Phillips" ha scritto nel messaggio
...
Hi from the UK,

here is one way

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
If Not Intersect(Target, Range("H1:H:32")) Is Nothing Then
Range("B1:B100").FormatConditions.Delete
For Each cell In Range("H1:H:32")
cell.FormatConditions.Add Type:=xlExpression, _
Formula1:="=" & cell.Address & "=" & Target.Address
cell.FormatConditions(1).Interior.ColorIndex = 3
Next cell
End If

End Sub

it is worksheet event code, so right-click on the sheet tab, select View
Code from the menu, and paste the code in

--







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default red Color for same value cells

Bob
saw it - neat BTW :-)

I was just too lazy...


--
Regards
Frank Kabel
Frankfurt, Germany


Bob Phillips wrote:
Frank,

See my answer.


"Frank Kabel" wrote in message
...
Hi
though this is possible (using the Selection_change event) this is
not that easy. It would be easier if you could enter the value in a
separate cell and use conditional format for this

--
Regards
Frank Kabel
Frankfurt, Germany


Aristotele64 wrote:
Hi from italy,
sorry if question was already posted but i dont'find anithing on
goole :
I have a column H1:H:32, example :

h1 Alfa
h2 Beta
h3 Omega
h4 Beta
h5 Omega
h6 Alfa
h7 P
h8 Alfa
h9 P
h10 ecc

when I click on cell taht contain "Alfa" , i want all "alfa" cell
become red if i click on cell that contain "Beta" , all "Beta"

cell
become red


TIA


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default red Color for same value cells

I tested on B1:B100 and changed just before I posted it. Missed that one.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Aristotele64" wrote in message
...
Many tkanks !!!!
It's working beatiful !!!!
I change only :

Range("B1:B100").FormatConditions.Delete

in
Range("H2:H32").FormatConditions.Delete


right ?

by and good evining !!



"Bob Phillips" ha scritto nel

messaggio
...
Hi from the UK,

here is one way

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
If Not Intersect(Target, Range("H1:H:32")) Is Nothing Then
Range("B1:B100").FormatConditions.Delete
For Each cell In Range("H1:H:32")
cell.FormatConditions.Add Type:=xlExpression, _
Formula1:="=" & cell.Address & "=" & Target.Address
cell.FormatConditions(1).Interior.ColorIndex = 3
Next cell
End If

End Sub

it is worksheet event code, so right-click on the sheet tab, select View
Code from the menu, and paste the code in

--







  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default red Color for same value cells

if only I could get rid of the iterating through all the cells!

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Frank Kabel" wrote in message
...
Bob
saw it - neat BTW :-)

I was just too lazy...


--
Regards
Frank Kabel
Frankfurt, Germany


Bob Phillips wrote:
Frank,

See my answer.


"Frank Kabel" wrote in message
...
Hi
though this is possible (using the Selection_change event) this is
not that easy. It would be easier if you could enter the value in a
separate cell and use conditional format for this

--
Regards
Frank Kabel
Frankfurt, Germany


Aristotele64 wrote:
Hi from italy,
sorry if question was already posted but i dont'find anithing on
goole :
I have a column H1:H:32, example :

h1 Alfa
h2 Beta
h3 Omega
h4 Beta
h5 Omega
h6 Alfa
h7 P
h8 Alfa
h9 P
h10 ecc

when I click on cell taht contain "Alfa" , i want all "alfa" cell
become red if i click on cell that contain "Beta" , all "Beta"

cell
become red


TIA




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default red Color for same value cells

Select H1:H32

with H1 the activeCell

format=Conditional formatting

formula is: =INDIRECT(CELL("address"))=H1

make red pattern the format.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("H1:H32")) Is Nothing Then
ActiveSheet.Calculate
End If
End Sub

--
Regards,
Tom Ogilvy


"Frank Kabel" wrote in message
...
Bob
saw it - neat BTW :-)

I was just too lazy...


--
Regards
Frank Kabel
Frankfurt, Germany


Bob Phillips wrote:
Frank,

See my answer.


"Frank Kabel" wrote in message
...
Hi
though this is possible (using the Selection_change event) this is
not that easy. It would be easier if you could enter the value in a
separate cell and use conditional format for this

--
Regards
Frank Kabel
Frankfurt, Germany


Aristotele64 wrote:
Hi from italy,
sorry if question was already posted but i dont'find anithing on
goole :
I have a column H1:H:32, example :

h1 Alfa
h2 Beta
h3 Omega
h4 Beta
h5 Omega
h6 Alfa
h7 P
h8 Alfa
h9 P
h10 ecc

when I click on cell taht contain "Alfa" , i want all "alfa" cell
become red if i click on cell that contain "Beta" , all "Beta"

cell
become red


TIA




  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default red Color for same value cells

Hi bob
maybe changing the conditional format formula via code

--
Regards
Frank Kabel
Frankfurt, Germany


Bob Phillips wrote:
if only I could get rid of the iterating through all the cells!


"Frank Kabel" wrote in message
...
Bob
saw it - neat BTW :-)

I was just too lazy...


--
Regards
Frank Kabel
Frankfurt, Germany


Bob Phillips wrote:
Frank,

See my answer.


"Frank Kabel" wrote in message
...
Hi
though this is possible (using the Selection_change event) this is
not that easy. It would be easier if you could enter the value in

a
separate cell and use conditional format for this

--
Regards
Frank Kabel
Frankfurt, Germany


Aristotele64 wrote:
Hi from italy,
sorry if question was already posted but i dont'find anithing on
goole :
I have a column H1:H:32, example :

h1 Alfa
h2 Beta
h3 Omega
h4 Beta
h5 Omega
h6 Alfa
h7 P
h8 Alfa
h9 P
h10 ecc

when I click on cell taht contain "Alfa" , i want all "alfa" cell
become red if i click on cell that contain "Beta" , all "Beta"
cell become red


TIA


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 color automatically color code sums in cells kuroitenpi Charts and Charting in Excel 1 November 29th 06 03:16 AM
How do I apply color in cells ..color now shown only in print prev bonadimi Excel Worksheet Functions 1 April 25th 06 07:34 PM
Excel 2003 will not display color fonts or color fill cells DaveC Excel Worksheet Functions 1 April 11th 05 04:38 PM
Color Formatted Cells not showing color jilary2 Excel Worksheet Functions 1 February 22nd 05 07:31 PM
My excel 2003 wont let me fill cells with color or color the tabs. trizog New Users to Excel 2 February 22nd 05 06:43 PM


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