|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Is there a way to automatically highlight the column and the row that of the current
Is there a way to automatically highlight the column and the row of the current cell?
I’m wondering if there is a way to highlight the row and the column of the current cell. For example, in the attached screenshots, I need a dynamic highlight for the row and the column of the current cell such that when the cell is changed then the column and the row of the new cell are highlighted. The current behavior of the Excel is based on highlighting only the header of the column and the row of the current cell but what I need is to automatically highlight the entire column and row of the current cell. Thank you in advance for the help Best Jamal
__________________
Jamal NUMAN, Jamal432@gmail.com, P.O.BoX: 731, Ramallah, West Bank. |
#3
|
|||
|
|||
Quote:
Thank you for the answer Pecoflyer. this does help. the code that you have provided is working very well but what i need is to highlight also beyond the active cell as shown in the screenshots in my first post. this code highlight only above and to the right of the active cell. what i need is to highlight above, under, left and right of the active cell. is that possible? regards Jamal
__________________
Jamal NUMAN, Jamal432@gmail.com, P.O.BoX: 731, Ramallah, West Bank. |
#4
|
|||
|
|||
Try this code:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub Application.ScreenUpdating = False ' Clear the color of all the cells Cells.Interior.ColorIndex = 0 With Target ' Highlight the entire row and column that contain the active cell .EntireRow.Interior.ColorIndex = 8 .EntireColumn.Interior.ColorIndex = 8 End With Application.ScreenUpdating = True End Sub |
#5
|
|||
|
|||
Quote:
thank you guys for the help appreciated Jamal
__________________
Jamal NUMAN, Jamal432@gmail.com, P.O.BoX: 731, Ramallah, West Bank. |
#6
|
||||
|
||||
Since you're using Excel 2010, you should probably change this line:
Code:
If Target.Cells.Count > 1 Then Exit Sub Code:
If Target.Cells.CountLarge > 1 Then Exit Sub |
#7
|
|||
|
|||
Quote:
i didn't find any problem with the code provided by zyzzyva57 please have a look on the attached screenshot. the code is working very well on the Excel 2010. regards Jamal
__________________
Jamal NUMAN, Jamal432@gmail.com, P.O.BoX: 731, Ramallah, West Bank. |
#8
|
||||
|
||||
Hi Jamal,
Quote:
It's because the Range.Count property was originally designed for pre-2007 worksheets which were smaller. Specifically, the Range.Count property returns a 32-bit Long Integer which can hold a maximum value of 2,147,483,647, but a worksheet in a 2007/10 format file has 17,179,869,184 cells, which is too large to be held in a Long Integer type. When the gridsize increased in the Excel 2007 release, it was accompanied by a new Range.CountLarge property which can handle the larger grid. |
#9
|
|||
|
|||
Quote:
best Jamal
__________________
Jamal NUMAN, Jamal432@gmail.com, P.O.BoX: 731, Ramallah, West Bank. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can I change the horizontal scrollbar to scroll smoothly rather than column by column | carpat | Excel | 0 | 01-10-2012 09:34 AM |
How to call current PC date and/or current PC year | KIM SOLIS | Excel | 2 | 11-04-2011 06:09 PM |
Current view filter applies automatically | lumisy | Outlook | 3 | 03-25-2011 05:44 AM |
Auto insert current month's name and current year | Styler001 | Word | 4 | 01-25-2010 06:40 PM |
find - reading highlight - highlight all / highlight doesn't stick when saved | bobk544 | Word | 3 | 04-15-2009 03:31 PM |