Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RJJ RJJ is offline
external usenet poster
 
Posts: 26
Default Highlight selected cells only

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 155
Default Highlight selected cells only

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RJJ RJJ is offline
external usenet poster
 
Posts: 26
Default Highlight selected cells only

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 155
Default Highlight selected cells only

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 155
Default Highlight selected cells only

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
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
Cells do not highlight when selected. Jay Excel Discussion (Misc queries) 1 November 12th 08 01:41 PM
Cells Won't Highlight when selected Javabumb Excel Discussion (Misc queries) 2 June 9th 08 07:36 PM
Highlight selected cells in 2007 PapaGuns Setting up and Configuration of Excel 0 April 15th 08 04:07 PM
change highlight colour of selected cells Starskys Bird Excel Discussion (Misc queries) 1 April 29th 06 02:27 PM
Cells no longer highlight when selected Stephen Excel Discussion (Misc queries) 0 April 22nd 05 08:31 PM


All times are GMT +1. The time now is 02:54 AM.

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"