Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-28-2018, 07:00 AM
lucato lucato is offline VBA highlight the entire row issue Windows 7 64bit VBA highlight the entire row issue Office 2010 64bit
Novice
VBA highlight the entire row issue
 
Join Date: Apr 2018
Location: Brazil
Posts: 6
lucato is on a distinguished road
Default VBA highlight the entire row issue


Hi folks, I was looking for how to highlight the entire row and found in this forum the VBA code bellow. The problem with such code is that it messed (removed) the all styles in my spreadsheet. So, I've lost all columns styles I had set. I know there is the option to SHIF+SPACE to select the entire row, but does anybody know how to have a code that doesn't remove the colors from columns and so on, so do not mess the style of a spreadsheet.? Thanks.


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
    Target.Parent.Cells.Interior.ColorIndex = 0
    With Target
        ' Highlight the entire row and column that contain the active cell
        .EntireRow.Interior.ColorIndex = 8
        
    End With
    Application.ScreenUpdating = True
End Sub
Reply With Quote
 

Tags
highligh, highlight row, vba code



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA highlight the entire row issue highlight the entire row of current cell Joanne Excel 32 05-20-2017 07:30 AM
VBA highlight the entire row issue issue with highlight macro word 2010 jamesnavoy Word VBA 2 01-29-2017 08:32 AM
PDF Conversion Issue - Background Tiled Image Size Issue dustpie Word 1 10-23-2016 07:33 PM
VBA highlight the entire row issue Excel 2007, highlight entire row based on data found in one cell MSofficeBLUE Excel 2 10-15-2013 09:51 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 11:27 PM.


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