Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 02-04-2017, 11:58 PM
NoSparks NoSparks is offline Clear all cell colors within a range starting at cell A8 and change row of active cell to yellow Windows 7 64bit Clear all cell colors within a range starting at cell A8 and change row of active cell to yellow Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Perhaps this will work... adapted from http://www.mrexcel.com/forum/excel-q...cted-cell.html

Assumes your colors are not conditional formatting.

Paste into the sheet module.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  Dim lr As Long
  Dim rng As Range
  
  lr = Range("A8").End(xlDown).Row
  Set rng = Range("A8:BZ" & lr)
  
  rng.Interior.ColorIndex = 0
  
  On Error Resume Next
  With Application
    .FindFormat.Clear
    .ReplaceFormat.Clear
    .FindFormat.Interior.ColorIndex = 27
    .ReplaceFormat.Interior.ColorIndex = xlNone
    ActiveSheet.UsedRange.Replace What:="", Replacement:="", SearchFormat:=True, ReplaceFormat:=True
    .FindFormat.Interior.ColorIndex = xlNone
    .ReplaceFormat.Interior.ColorIndex = 27
    Intersect(Target.EntireRow, rng).Replace What:="", Replacement:="", SearchFormat:=True, ReplaceFormat:=True
  End With
End Sub
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear all cell colors within a range starting at cell A8 and change row of active cell to yellow If value of cell A Matches a value in a Range of cells (column) then add value of cell A to cell C rick10r Excel 1 07-05-2016 12:07 PM
Dymanic Range Starting at a Cell Defined by a Count jap7675 Excel Programming 7 12-02-2015 02:12 AM
Clear all cell colors within a range starting at cell A8 and change row of active cell to yellow If id cell range is empty then should not allow to fill any other cell ubns Excel Programming 2 04-12-2015 06:31 AM
Change formula cell range based on cell value Scoth Excel 4 10-25-2012 07:51 AM
How can I fill cell color starting from Cell D5 using Conditional formatting instead Learner7 Excel 0 07-08-2010 05:50 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:44 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