Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 577
Default Find a color value

GDay,

I have a worksheet which users can change the color of a particular cell €“
assume C3. What I want to do is change the color of another worksheet tab
(within the same workbook) to match the cell color of C3.

Can anyone help?

Cheers

Scott
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 434
Default Find a color value

hi, Scott !

I have a worksheet which users can change the color of a particular cell assume C3.
What I want to do is change the color of another worksheet tab (within the same workbook) to match the cell color of C3.


assuming the "other" worksheet is "Sheet2", put this code into C3 cell's source sheet (code module)...
(note you will need '_selectionchange' event to be triggered and excel version 2002/xp or above)

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myColor As Integer
myColor = Range("c3").Interior.ColorIndex
With Worksheets("sheet2").Tab
If .ColorIndex < myColor Then .ColorIndex = myColor
End With
End Sub

hth,
hector.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 577
Default Find a color value

Hector,

Thanks for the response. I tried this but unfortunately i get the error
"run-time error 438 Object doesn't support this property or method" and then
the VB Editor highlights the code line:
With Worksheets("sheet2").Tab

I tried renaming the sheet "Sheet2" in case the capital made a difference
and tried different sheets, but all with no luck.

I am running Excel 2000.

Appreciate your help

Scott

"Héctor Miguel" wrote:

hi, Scott !

I have a worksheet which users can change the color of a particular cell assume C3.
What I want to do is change the color of another worksheet tab (within the same workbook) to match the cell color of C3.


assuming the "other" worksheet is "Sheet2", put this code into C3 cell's source sheet (code module)...
(note you will need '_selectionchange' event to be triggered and excel version 2002/xp or above)

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myColor As Integer
myColor = Range("c3").Interior.ColorIndex
With Worksheets("sheet2").Tab
If .ColorIndex < myColor Then .ColorIndex = myColor
End With
End Sub

hth,
hector.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Find a color value

The ability to change tab colors was added in xl2002.

Scott wrote:

Hector,

Thanks for the response. I tried this but unfortunately i get the error
"run-time error 438 Object doesn't support this property or method" and then
the VB Editor highlights the code line:
With Worksheets("sheet2").Tab

I tried renaming the sheet "Sheet2" in case the capital made a difference
and tried different sheets, but all with no luck.

I am running Excel 2000.

Appreciate your help

Scott

"Héctor Miguel" wrote:

hi, Scott !

I have a worksheet which users can change the color of a particular cell assume C3.
What I want to do is change the color of another worksheet tab (within the same workbook) to match the cell color of C3.


assuming the "other" worksheet is "Sheet2", put this code into C3 cell's source sheet (code module)...
(note you will need '_selectionchange' event to be triggered and excel version 2002/xp or above)

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myColor As Integer
myColor = Range("c3").Interior.ColorIndex
With Worksheets("sheet2").Tab
If .ColorIndex < myColor Then .ColorIndex = myColor
End With
End Sub

hth,
hector.




--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 434
Default Find a color value

hi, Scott !

... i get the error "run-time error 438 Object doesn't support this property or method"
and then the VB Editor highlights the code line:
With Worksheets("sheet2").Tab
(...)
I am running Excel 2000.


I think you missed this part from my proposal...

(note you will need '_selectionchange' event to be triggered and excel version 2002/xp or above)


(I'm sorry but xl-2000 doesn't support tab color changes)

regards,
hector.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 577
Default Find a color value

Hectoe,

Thx for your time, I am sorry I miss understood - I thought I needed to a
selectchange event IF it was excel 2002+ not AND.

Again thanks fro your time

Scott

"Héctor Miguel" wrote:

hi, Scott !

... i get the error "run-time error 438 Object doesn't support this property or method"
and then the VB Editor highlights the code line:
With Worksheets("sheet2").Tab
(...)
I am running Excel 2000.


I think you missed this part from my proposal...

(note you will need '_selectionchange' event to be triggered and excel version 2002/xp or above)


(I'm sorry but xl-2000 doesn't support tab color changes)

regards,
hector.



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
formula to find out the color an excel cell is highlighted? Ted Excel Worksheet Functions 4 August 10th 07 05:16 PM
find excel rows with a background color Lou Excel Discussion (Misc queries) 4 May 24th 07 01:27 AM
Find feature - Fill cells with color dford Excel Discussion (Misc queries) 8 March 12th 07 04:10 PM
Can't format cell color/text color in Office Excel 2003 in files . albertaman Excel Discussion (Misc queries) 0 February 16th 06 03:56 AM
How do I find highest number in a row and change color? pamstolen Excel Worksheet Functions 3 January 18th 05 12:35 AM


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