Highlighting The Active Cell

MS EXCEL

    Next

  • 1. March 2005 Actual Info vs March 2006 Plan Info
    I have a large spreadsheet which needs to populate actual information for March 2005 and Plan information for March 2006. (each month contains both plan and actual information. I'm using ADO to populate this spreadsheet, so I need range names which properly differentiate between these two months. My tentative solution is to use the range name 'MARCH1' {for the first instance of March, March 2005}, and to use the range name 'MARCH2' {for the second instance of March, March 2006} I'll use a table to identify the range name for which I'm updating actual information. and another table to identify the range names for which i'm updating plan information. I did not include the year in the range name, because next year, I'd want to roll the year and not make any changes to the range name. {populate March 2006 Actual Information and populate March 2007 Plan Information} I was wondering if anyone knew of a better way to do this. Thanks in advance.
  • 2. Sort Data for duplicates
    I would like some code that will sort my data based on column B. I do not want to delete the duplicates, just have them togetherfor this macro. I would like a seperate macro just to delte the dups based on column B Thanks. I want to see the steps for future improvement in the code -- Mike B

Highlighting The Active Cell

Postby Pelham » Fri, 31 Mar 2006 18:19:33 GMT

This is a Macro for 'Highlighting The Active Cell' that will change
the background color of the ActiveCell to yellow anytime you select a
new cell, either with the mouse or with the arrow keys.


Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object,
    ByVal Target As Excel.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

The author says that if one wants to make the active cell appear in a
special color, use the following this code in the
Workbook_SheetSelectionChange event of the workbook. BUT, I am not good
with VBA or Macros yet so I do not know what he means ... How do I get
this Macro to work?


Re: Highlighting The Active Cell

Postby Norman Jones » Fri, 31 Mar 2006 18:29:05 GMT

Hi Pelham,

This is workbook event code and should be pasted into the workbook's 
ThisWorkbook module *not* a standard module or a sheet module:

Right-click the Excel icon on the worksheet
(or the icon to the left of the File menu if your workbook is maximised)

Select 'View Code' from the menu and paste the code.

Alt-F11 to return to Excel.


---
Regards,
Norman










Re: Highlighting The Active Cell

Postby Pelham » Sun, 02 Apr 2006 22:53:51 GMT

Hi Norman

Thanks so much!

I am a real rookie to VBA, so can you point me to a summary page of the
different VBA environments because I do not know the difference between
'workbook event code', 'standard module' or 'sheet module' etc.? All I
know about VBA is that you get to the VBE by pressing Alt+F11...!!!

Regards
Pelham









Similar Threads:

1.Highlighting the active cell during "Find"

When I search (Find) for a term, how can I highlight the active cell that it 
finds. Ccurrently, it only outlines the cell, kinda hard to spot.  I just 
need this for the Find" function, not during data entry.

2.Format / Highlight the Active Cell

I have found some good solutions to my problem, but not one that fits
the bill exactly.

I'm looking to format the active cell with a yellow background, but I
need to ensure that the cell's format previous to it being active
remains as it was after the cell is no longer active. All the solutions
I have seen remove the background after the cell is no longer active.

So, if I have a cell with a black background (for instance) and I make
it the active cell the cell will have a yellow background. After I
leave that cell, I need it to return to it's previous state - black
background, not none.

I have tried this code...

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object,
    ByVal Target As Excel.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

...and I think the answer may lie here "OldRange.Interior.ColorIndex =
xlColorIndexNone"

Any help would be greatly appreciated. Thank you in advance!

-M

3.Conditional Format to Highlight the Active Cell

I have created a protected sheet with a few pre-populated, unlocked data 
entry cells. Is there a way to create a Conditional Format to "highlight" the 
activecell that the user is on? I cannot use VB since the sheet will be used 
on secured systems and the macro will be blocked.


4.Highlighting an active cell

I have a workbook of floorplans with desk no's and pc no's. I have created 
bookmark links to another worksheet within this workbook that contains user 
name tel no and pc details, There are over 300 names in this sheet. Is it 
possible to highlight say in yellow the cell that becomes active when I enter 
it from my link.

Your help here would be very much appreciated.

5.Highlight active cell and de-highlight previous cell

I want to highlight the current cell with a color say gray and set the color 
of the last cell I was at back to what it currently was. The code below does 
not work. It sets the previous cell color to white and if the cell color was 
something other than white, say green, I lose the color green for the 
previous cell.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next

    Static OldRange As Range

    'Set backcolor to whatever, change as needed
    Target.Interior.ColorIndex = 15    'light gray

    OldRange.Interior.ColorIndex = xlColorIndexNone
    Set OldRange = Target

End Sub

-- 
Dave B.

6. Row select mode to highlight active row of active cell

7. How do I highlight the active cell in a spreadsheet?

8. Highlight the cells referenced in the active cell formula



Return to MS EXCEL

 

Who is online

Users browsing this forum: No registered users and 43 guest