Code to Remove Shading Not Working

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
3,812
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?
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,782
Office Version
  1. 2010
Platform
  1. Windows
Got conditional formatting?
 

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
3,812
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I think I do ... how can I remove it then for that range?
 

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
3,812
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
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
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,782
Office Version
  1. 2010
Platform
  1. Windows
What With statement surrounds the code?
 

Watch MrExcel Video

Forum statistics

Threads
1,123,402
Messages
5,601,475
Members
414,452
Latest member
Dannysamworth

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
Top