Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How to apply colouring as in Cells associated with Forumla

hi,

When there is a sum formula applied to a cell for example

cell A5 = Cell A1 + Cell A2 + Cell A3+ Cell A4

and when we click on cell A5 each of the cells that are part of the formula
is given various random (i think so) colours

How can i do the same programatically? My goal is not to apply formula but
to show cells or range of cells in various kind of colours temporarily. I am
looking for a solution where i dont have to work with cell border colours..

Please let me know if my question is not clear.

Any pointers in this regard will be very helpful

Regards,
Abhilash



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default How to apply colouring as in Cells associated with Forumla

If you have no other coloured cells on the sheet (as their formatting will be
cleared) you could try a selection change event like this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Cell As Range
Dim i As Integer
Application.EnableEvents = False
Cells.Interior.ColorIndex = False
If Target.Count = 1 Then
On Error Resume Next
i = 37
For Each Cell In Target.Precedents
If i = 47 Then i = 33
Cell.Interior.ColorIndex = i
i = i + 1
Next Cell
On Error GoTo 0
End If
Application.EnableEvents = True
End Sub

Hope this helps
Rowan

In case you are unfamiliar with worksheet events right click the sheet tab,
select view code and paste the code.


"news.microsoft.com" wrote:

hi,

When there is a sum formula applied to a cell for example

cell A5 = Cell A1 + Cell A2 + Cell A3+ Cell A4

and when we click on cell A5 each of the cells that are part of the formula
is given various random (i think so) colours

How can i do the same programatically? My goal is not to apply formula but
to show cells or range of cells in various kind of colours temporarily. I am
looking for a solution where i dont have to work with cell border colours..

Please let me know if my question is not clear.

Any pointers in this regard will be very helpful

Regards,
Abhilash




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to apply colouring as in Cells associated with Forumla


Are these completely random colors, or is it like if the value of th
cell is under 10, you want it green, and if valu eis above 10 is red?
If the latter is true, you can apply conditional formatting to thes
cells. To use conditional formatting, highlight the cells you wan
formatted, click on Format, then click Conditional Formatting. It i
pretty self-explanatory from that point, however, if you have troubl
just let me know and I can explain it a little further

--
RarrMik
-----------------------------------------------------------------------
RarrMike's Profile: http://www.excelforum.com/member.php...fo&userid=2563
View this thread: http://www.excelforum.com/showthread.php?threadid=39048

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How to apply colouring as in Cells associated with Forumla

Hello,

First thank you for your reply. I think i didnt express my question well.
Acutally i dont need to color within a cell because the cells may already
have colors that i should not modify

What i want is kind of highlight the boundary of cell or range of cells
using various (random colours) to differentiate cells or range. I dont want
to change the existing border color either. What is want is similar to what
Excel shows when you click on a cell that depends upon other cells for
example in summation, a kind of blue boundray which appears or if there are
many non continous cells it shows it in various colors.

Is this possible programmatically?

Regards
Abhilash


"Rowan" wrote in message
...
If you have no other coloured cells on the sheet (as their formatting will
be
cleared) you could try a selection change event like this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Cell As Range
Dim i As Integer
Application.EnableEvents = False
Cells.Interior.ColorIndex = False
If Target.Count = 1 Then
On Error Resume Next
i = 37
For Each Cell In Target.Precedents
If i = 47 Then i = 33
Cell.Interior.ColorIndex = i
i = i + 1
Next Cell
On Error GoTo 0
End If
Application.EnableEvents = True
End Sub

Hope this helps
Rowan

In case you are unfamiliar with worksheet events right click the sheet
tab,
select view code and paste the code.


"news.microsoft.com" wrote:

hi,

When there is a sum formula applied to a cell for example

cell A5 = Cell A1 + Cell A2 + Cell A3+ Cell A4

and when we click on cell A5 each of the cells that are part of the
formula
is given various random (i think so) colours

How can i do the same programatically? My goal is not to apply formula
but
to show cells or range of cells in various kind of colours temporarily. I
am
looking for a solution where i dont have to work with cell border
colours..

Please let me know if my question is not clear.

Any pointers in this regard will be very helpful

Regards,
Abhilash






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How to apply colouring as in Cells associated with Forumla

Hello,

First thank you for your reply. I think i didnt express my question well.
Acutally i dont need to color within a cell because the cells may already
have colors that i should not modify

What i want is kind of highlight the boundary of cell or range of cells
using various (random colours) to differentiate cells or range. I dont want
to change the existing border color either. What is want is similar to what
Excel shows when you click on a cell that depends upon other cells for
example in summation, a kind of blue boundray which appears or if there are
many non continous cells it shows it in various colors.

Is this possible programmatically?

Regards,
Abhilash

"RarrMike" wrote in
message ...

Are these completely random colors, or is it like if the value of the
cell is under 10, you want it green, and if valu eis above 10 is red?
If the latter is true, you can apply conditional formatting to these
cells. To use conditional formatting, highlight the cells you want
formatted, click on Format, then click Conditional Formatting. It is
pretty self-explanatory from that point, however, if you have trouble
just let me know and I can explain it a little further.


--
RarrMike
------------------------------------------------------------------------
RarrMike's Profile:
http://www.excelforum.com/member.php...o&userid=25637
View this thread: http://www.excelforum.com/showthread...hreadid=390481





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How to apply colouring as in Cells associated with Forumla

Hello,

First thank you for your reply. I think i didnt express my question well.
Acutally i dont need to color within a cell because the cells may already
have colors that i should not modify

What i want is kind of highlight the boundary of cell or range of cells
using various (random colours) to differentiate cells or range. I dont want
to change the existing border color either. What is want is similar to what
Excel shows when you click on a cell that depends upon other cells for
example in summation, a kind of blue boundray which appears or if there are
many non continous cells it shows it in various colors.

Is this possible programmatically?

Regards
Abhilash


"Rowan" wrote in message
...
If you have no other coloured cells on the sheet (as their formatting will
be
cleared) you could try a selection change event like this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Cell As Range
Dim i As Integer
Application.EnableEvents = False
Cells.Interior.ColorIndex = False
If Target.Count = 1 Then
On Error Resume Next
i = 37
For Each Cell In Target.Precedents
If i = 47 Then i = 33
Cell.Interior.ColorIndex = i
i = i + 1
Next Cell
On Error GoTo 0
End If
Application.EnableEvents = True
End Sub

Hope this helps
Rowan

In case you are unfamiliar with worksheet events right click the sheet
tab,
select view code and paste the code.


"news.microsoft.com" wrote:

hi,

When there is a sum formula applied to a cell for example

cell A5 = Cell A1 + Cell A2 + Cell A3+ Cell A4

and when we click on cell A5 each of the cells that are part of the
formula
is given various random (i think so) colours

How can i do the same programatically? My goal is not to apply formula
but
to show cells or range of cells in various kind of colours temporarily. I
am
looking for a solution where i dont have to work with cell border
colours..

Please let me know if my question is not clear.

Any pointers in this regard will be very helpful

Regards,
Abhilash






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How to apply colouring as in Cells associated with Forumla

Hello,

First thank you for your reply. I think i didnt express my question well.
Acutally i dont need to color within a cell because the cells may already
have colors that i should not modify

What i want is kind of highlight the boundary of cell or range of cells
using various (random colours) to differentiate cells or range. I dont want
to change the existing border color either. What is want is similar to what
Excel shows when you click on a cell that depends upon other cells for
example in summation, a kind of blue boundray which appears or if there are
many non continous cells it shows it in various colors.

Is this possible programmatically?

Regards,
Abhilash
"RarrMike" wrote in
message ...

Are these completely random colors, or is it like if the value of the
cell is under 10, you want it green, and if valu eis above 10 is red?
If the latter is true, you can apply conditional formatting to these
cells. To use conditional formatting, highlight the cells you want
formatted, click on Format, then click Conditional Formatting. It is
pretty self-explanatory from that point, however, if you have trouble
just let me know and I can explain it a little further.


--
RarrMike
------------------------------------------------------------------------
RarrMike's Profile:
http://www.excelforum.com/member.php...o&userid=25637
View this thread: http://www.excelforum.com/showthread...hreadid=390481



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default How to apply colouring as in Cells associated with Forumla

You can use Conditional Formatting to color the borders.
Remove the Conditional Formatting and the colors all
return to normal.

I don't know anything about your seeing different colors
in the cells that are named in the formulas. What version of
Excel do yo have.

You can in any version of Excel see cell dependencies.
tools, customize, left tab is toolbars, click on Auditing toolbars.
You can then check out cell dependencies.


---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"news.microsoft.com" wrote in message ...
Hello,

First thank you for your reply. I think i didnt express my question well.
Acutally i dont need to color within a cell because the cells may already
have colors that i should not modify

What i want is kind of highlight the boundary of cell or range of cells
using various (random colours) to differentiate cells or range. I dont want
to change the existing border color either. What is want is similar to what
Excel shows when you click on a cell that depends upon other cells for
example in summation, a kind of blue boundray which appears or if there are
many non continous cells it shows it in various colors.

Is this possible programmatically?

Regards,
Abhilash
"RarrMike" wrote in
message ...

Are these completely random colors, or is it like if the value of the
cell is under 10, you want it green, and if valu eis above 10 is red?
If the latter is true, you can apply conditional formatting to these
cells. To use conditional formatting, highlight the cells you want
formatted, click on Format, then click Conditional Formatting. It is
pretty self-explanatory from that point, however, if you have trouble
just let me know and I can explain it a little further.


--
RarrMike
------------------------------------------------------------------------
RarrMike's Profile:
http://www.excelforum.com/member.php...o&userid=25637
View this thread: http://www.excelforum.com/showthread...hreadid=390481





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
automate the colouring of lots of cells [email protected] Excel Discussion (Misc queries) 1 September 26th 06 10:42 AM
Excel Macro for colouring cells Flash Excel Discussion (Misc queries) 2 July 13th 06 06:18 PM
Automatic colouring of cells Hustler24 Excel Discussion (Misc queries) 2 June 28th 06 09:18 AM
Automatic colouring of cells plf100 Excel Worksheet Functions 3 March 29th 06 03:10 PM
Colouring cells Sam A Excel Programming 2 August 17th 04 03:27 PM


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