Code to Remove Shading Not Working

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have this chunk of code:

Code:
If llastrow < 2 Then
     .Rows("13:34").Insert Shift:=xlDown
     llastrow = 34
     With .Range("A13:Q34").Cells
          .Interior.ColorIndex = xlNone
          .Borders(xlInsideHorizontal).Weight = xlHairline
     End With
End If

It's purpose is simple .... remove existing shading of cells in range A13:Q34, and leave behind hairline horizontal lines.

I am unable to get the shading removed with .Interior.ColorIndex = xlNone.

Thoughts?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Got conditional formatting?
 
Upvote 0
I think I do ... how can I remove it then for that range?
 
Upvote 0
I added the line in blue, with no success.

Rich (BB code):
If llastrow < 2 Then
     .Rows("13:34").Insert Shift:=xlDown
     llastrow = 34
     With .Range("A13:Q34").Cells
          .FormatConditions.Delete
          .Interior.ColorIndex = xlNone
          .Borders(xlInsideHorizontal).Weight = xlHairline
     End With
End If
 
Upvote 0
What With statement surrounds the code?
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,753
Members
449,094
Latest member
dsharae57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top