Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
formula to find out the color an excel cell is highlighted? | Excel Worksheet Functions | |||
find excel rows with a background color | Excel Discussion (Misc queries) | |||
Find feature - Fill cells with color | Excel Discussion (Misc queries) | |||
Can't format cell color/text color in Office Excel 2003 in files . | Excel Discussion (Misc queries) | |||
How do I find highest number in a row and change color? | Excel Worksheet Functions |