Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a macro on sheet (1) that takes me to a specific cell on sheet (2). I
need the now selected cell on sheet(2) to highlight to some color (yellow probably). The macros on sheet (1) are along side a long list of names. So as I select the appropriate macro, the appropriate cell needs to highlight on sheet (2). This workbook will ultimately be placed on a server drive so the formatting, code, macro or whatever needs to be within the workbook and not an add-on that is specific to the terminal. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi RJJ,
Since the macros take you to sected cells, you can add this to each macro. If your selected cell on the first macro is A1: (You can most likely omit the first line since your macro will take you to the specified cell) Range("A1").Select With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .color = 65535 .TintAndShade = 0 .PatternTintAndShade = 0 End With This will add the color Yellow to the cell. Squeaky "RJJ" wrote: I have a macro on sheet (1) that takes me to a specific cell on sheet (2). I need the now selected cell on sheet(2) to highlight to some color (yellow probably). The macros on sheet (1) are along side a long list of names. So as I select the appropriate macro, the appropriate cell needs to highlight on sheet (2). This workbook will ultimately be placed on a server drive so the formatting, code, macro or whatever needs to be within the workbook and not an add-on that is specific to the terminal. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Almost but,
the cell is changed to yellow but I need it to revert back to "no fill" when unselected "Squeaky" wrote: Hi RJJ, Since the macros take you to sected cells, you can add this to each macro. If your selected cell on the first macro is A1: (You can most likely omit the first line since your macro will take you to the specified cell) Range("A1").Select With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .color = 65535 .TintAndShade = 0 .PatternTintAndShade = 0 End With This will add the color Yellow to the cell. Squeaky "RJJ" wrote: I have a macro on sheet (1) that takes me to a specific cell on sheet (2). I need the now selected cell on sheet(2) to highlight to some color (yellow probably). The macros on sheet (1) are along side a long list of names. So as I select the appropriate macro, the appropriate cell needs to highlight on sheet (2). This workbook will ultimately be placed on a server drive so the formatting, code, macro or whatever needs to be within the workbook and not an add-on that is specific to the terminal. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi RJJ,
The best I have been able to work out is you will have to select another cell then reclick the first cell to change the color back to no color. I do not know if it is possible to change to a color when you click on, and change back when you click off a cell. Squeaky "RJJ" wrote: Almost but, the cell is changed to yellow but I need it to revert back to "no fill" when unselected "Squeaky" wrote: Hi RJJ, Since the macros take you to sected cells, you can add this to each macro. If your selected cell on the first macro is A1: (You can most likely omit the first line since your macro will take you to the specified cell) Range("A1").Select With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .color = 65535 .TintAndShade = 0 .PatternTintAndShade = 0 End With This will add the color Yellow to the cell. Squeaky "RJJ" wrote: I have a macro on sheet (1) that takes me to a specific cell on sheet (2). I need the now selected cell on sheet(2) to highlight to some color (yellow probably). The macros on sheet (1) are along side a long list of names. So as I select the appropriate macro, the appropriate cell needs to highlight on sheet (2). This workbook will ultimately be placed on a server drive so the formatting, code, macro or whatever needs to be within the workbook and not an add-on that is specific to the terminal. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I found this at http://www.cpearson.com/excel/excelM...ightActiveCell
As per instructions use the following code in the Workbook_SheetSelectionChange event of the workbook. It works great. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Static OldRange As Range On Error Resume Next Target.Interior.ColorIndex = 6 ' yellow - change as needed OldRange.Interior.ColorIndex = xlColorIndexNone Set OldRange = Target End Sub Squeaky "Squeaky" wrote: Hi RJJ, The best I have been able to work out is you will have to select another cell then reclick the first cell to change the color back to no color. I do not know if it is possible to change to a color when you click on, and change back when you click off a cell. Squeaky "RJJ" wrote: Almost but, the cell is changed to yellow but I need it to revert back to "no fill" when unselected "Squeaky" wrote: Hi RJJ, Since the macros take you to sected cells, you can add this to each macro. If your selected cell on the first macro is A1: (You can most likely omit the first line since your macro will take you to the specified cell) Range("A1").Select With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .color = 65535 .TintAndShade = 0 .PatternTintAndShade = 0 End With This will add the color Yellow to the cell. Squeaky "RJJ" wrote: I have a macro on sheet (1) that takes me to a specific cell on sheet (2). I need the now selected cell on sheet(2) to highlight to some color (yellow probably). The macros on sheet (1) are along side a long list of names. So as I select the appropriate macro, the appropriate cell needs to highlight on sheet (2). This workbook will ultimately be placed on a server drive so the formatting, code, macro or whatever needs to be within the workbook and not an add-on that is specific to the terminal. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cells do not highlight when selected. | Excel Discussion (Misc queries) | |||
Cells Won't Highlight when selected | Excel Discussion (Misc queries) | |||
Highlight selected cells in 2007 | Setting up and Configuration of Excel | |||
change highlight colour of selected cells | Excel Discussion (Misc queries) | |||
Cells no longer highlight when selected | Excel Discussion (Misc queries) |