Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlight column heading of current cell
I have searched and cannot find an answer. I am using Excel 2000 and
would like to create a function that will highlight a column heading in row three if the current cell is in that particular column. Let's say I have 10 columns. If I am at a cell in any row in column 2, then highlight cell B2 else leave white. Is this possible via vba? How? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlight column heading of current cell
Hi C,
Try: '============= Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Range("B3") If Target.Column = 2 Then .Interior.ColorIndex = 6 Else .Interior.ColorIndex = xlNone End If End With End Sub '<<============= This is worksheet event code and should be pasted into the worksheets's code module (not a standard module and not the workbook's ThisWorkbook module): Right-click the worksheet's tab Select 'View Code' from the menu and paste the code. Alt-F11 to return to Excel. --- Regards, Norman wrote in message oups.com... I have searched and cannot find an answer. I am using Excel 2000 and would like to create a function that will highlight a column heading in row three if the current cell is in that particular column. Let's say I have 10 columns. If I am at a cell in any row in column 2, then highlight cell B2 else leave white. Is this possible via vba? How? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlight column heading of current cell
Hi C,
I should add that you indicate the header row to be row 3: function that will highlight a column heading in row three But, later, you say: If I am at a cell in any row in column 2, then highlight cell B2 My code assumes the first definition. If, however, the header row is row 2, change: With Range("B3") to With Range("B2") --- Regards, Norman "Norman Jones" wrote in message ... Hi C, Try: '============= Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Range("B3") If Target.Column = 2 Then .Interior.ColorIndex = 6 Else .Interior.ColorIndex = xlNone End If End With End Sub '<<============= This is worksheet event code and should be pasted into the worksheets's code module (not a standard module and not the workbook's ThisWorkbook module): Right-click the worksheet's tab Select 'View Code' from the menu and paste the code. Alt-F11 to return to Excel. --- Regards, Norman |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlight column heading of current cell
right click sheet tabview codecopy/paste this. Be aware that it will erase
all others. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Cells.Interior.ColorIndex = xlColorIndexNone Cells(3, Target.Column).Interior.ColorIndex = 36 End Sub -- Don Guillett SalesAid Software wrote in message oups.com... I have searched and cannot find an answer. I am using Excel 2000 and would like to create a function that will highlight a column heading in row three if the current cell is in that particular column. Let's say I have 10 columns. If I am at a cell in any row in column 2, then highlight cell B2 else leave white. Is this possible via vba? How? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlight column heading of current cell
Hi Don,
I suspect that your interpretation is the correct one! --- Regards, Norman "Don Guillett" wrote in message ... right click sheet tabview codecopy/paste this. Be aware that it will erase all others. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Cells.Interior.ColorIndex = xlColorIndexNone Cells(3, Target.Column).Interior.ColorIndex = 36 End Sub -- Don Guillett SalesAid Software wrote in message oups.com... I have searched and cannot find an answer. I am using Excel 2000 and would like to create a function that will highlight a column heading in row three if the current cell is in that particular column. Let's say I have 10 columns. If I am at a cell in any row in column 2, then highlight cell B2 else leave white. Is this possible via vba? How? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlight column heading of current cell
Thanks Don, that did the trick. Just could not find the right syntax.
You're awsome! |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlight column heading of current cell
Aw shucks, glad to help.
-- Don Guillett SalesAid Software wrote in message ups.com... Thanks Don, that did the trick. Just could not find the right syntax. You're awsome! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
highlight row/column to track current cell ... and more! | New Users to Excel | |||
how to highlight current row & column automatically by a color | Excel Discussion (Misc queries) | |||
highlight current row/column | Excel Discussion (Misc queries) | |||
how do I highlight the current row and column | Excel Discussion (Misc queries) | |||
how to highlight current row & column automatically by a color | Excel Discussion (Misc queries) |