Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2012, 05:06 PM
zyzzyva57 zyzzyva57 is offline Is there a way to automatically highlight the column and the row that of the current Windows 7 32bit Is there a way to automatically highlight the column and the row that of the current Office 2007
Expert
 
Join Date: Mar 2009
Location: Dawsonville, Ga (NE of Atl)
Posts: 355
zyzzyva57 is on a distinguished road
Default

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

Reply With Quote
  #2  
Old 02-13-2012, 12:48 AM
Jamal NUMAN Jamal NUMAN is offline Is there a way to automatically highlight the column and the row that of the current Windows 7 64bit Is there a way to automatically highlight the column and the row that of the current Office 2010 64bit
Expert
Is there a way to automatically highlight the column and the row that of the current
 
Join Date: Nov 2010
Posts: 615
Jamal NUMAN is on a distinguished road
Thumbs up

Quote:
Originally Posted by zyzzyva57 View Post
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
Thank you for the answer zyzzyva57. that's perfect. this is exactly what I'm looking for.

thank you guys for the help

appreciated

Jamal
Reply With Quote
Reply



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
Is there a way to automatically highlight the column and the row that of the current 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
Is there a way to automatically highlight the column and the row that of the current 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:30 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft