Apparently you misunderstood me. I know how to apply the code. I'm just not able to create the code myself.
So thanks again for the code, it works perfect.
Maybe you can tell me how you got the color codes? I'm used to create a macro, applying a color to a cell and then read the code in VBA. The result is then a one or two digit number, example: gray-25% = 15. So how do you get 12632256 for gray-25%?
Try this.........
Sub Testing()
Dim iColor As Long
Dim i, j As Integer
For I = 7 To 18
For j = 5 To 35
iColor = Cells(i, j).Interior.Color
Select Case iColor
Case 16777215 ' white color
Cells(i, j).ClearContents
Case 12632256 ' gray - 25%
Cells(i, j).ClearContents
Case 3355443 'gray - 80%
Cells(i, j).ClearContents
End Select
Next j
Next i
1. Swith to VBA editor mode by press Atl + F11
2. copy this code to VBA editor
3. swith to Excel sheet by press Atl + F11
4.on toolbar, Click right and select "Forms" menu
5.click button and creat it to your sheet
6.select procedure name and click OK.
If you still don't understand please sent your file to me.
I will make the example on your sheet and sent back to you..........
'get corlor number use below code
Sub FindInteriorColorNumber()
'Chage color at A1 and run this code
MsgBox Range("A1").Interior.Color
End Sub
Code on below is combine your module
'===============================================
Sub UPDATEDATA()
'This code works for range E7:AI18. I want to add the following ranges:
'E35:AI46, E54:AI65, E73:AI84, E92:AI103.
Sub Testing(ByVal FR_ As Integer, ByVal TR_ As Integer, ByVal FC_ As Integer, ByVal TC_ As Integer)
Dim iColor As Long
Dim i, j As Integer
For I = FR_ To TR_
For j = FC_ To TC_
iColor = Cells(i, j).Interior.Color
Select Case iColor
Case 16777215 ' white color
Cells(i, j).ClearContents
Case 12632256 ' gray - 25%
Cells(i, j).ClearContents
Case 3355443 'gray - 80%
Cells(i, j).ClearContents
End Select
Next j
Next i