Hi all,
I am unsuccessfully trying to speed up my un-highlight selected cells macro. I have been toying with the code to speed it up as if I mistakenly select an entire row it takes a long time to complete. But I am too useless and have failed to get it working correctly. I have also been trying to insert the 'Do Until' code and putting in a loop.
What I am after is for the macro to search through all of the selected cells and if the cell has no fill colour applied then it will skip to the next selected cell with a fill colour. For all other cells that are filled with colour the macro will apply a colour index = 0.
Here is my faulty code:
Any help is appreciated,
Thanks
I am unsuccessfully trying to speed up my un-highlight selected cells macro. I have been toying with the code to speed it up as if I mistakenly select an entire row it takes a long time to complete. But I am too useless and have failed to get it working correctly. I have also been trying to insert the 'Do Until' code and putting in a loop.
What I am after is for the macro to search through all of the selected cells and if the cell has no fill colour applied then it will skip to the next selected cell with a fill colour. For all other cells that are filled with colour the macro will apply a colour index = 0.
Here is my faulty code:
Code:
Sub Un_Highlight_Selected_Cells()
Application.ScreenUpdating = False
Dim Rng As Range, cell As Range
Set Rng = Selection
For Each cell In Rng
If cell.Interior.ColorIndex = xlColorIndexNone Then
cell.Offset(0, 1).Select
Else: cell.Interior.ColorIndex = 0
Next cell
Application.ScreenUpdating = True
End Sub
Any help is appreciated,
Thanks