CHANGE CELL VALUE BASED ON TWO OTHER CELLS' VALUES

Closed
dbsimoes92 Posts 3 Registration date Tuesday April 1, 2014 Status Member Last seen April 3, 2014 - Apr 1, 2014 at 03:18 PM
Hi, i'm trying to right a code that makes a change and then try to applies it on other tab by taking the value of one cell that returns the number of the row and the value of the next cell that returns the number of the column and select that cell and applies the change. the error is at Cells(a, b).Select

If Target.Row < 500 And Target.Column = 6 Then
For x = 8 To 500
If Cells(x, 6).Value = "C" Then
a = Cells(x, 12).Value
b = Cells(x, 13).Value
Sheets("13").Select
ActiveSheet.Protect "1", DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFiltering:=True
ActiveSheet.Unprotect "1"
Cells(a, b).Select
ActiveCell.ClearContents
ActiveCell.FormulaR1C1 = "C"
ActiveSheet.Protect "1", DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFiltering:=True
Sheets("VERSO").Select
End If
Next x
End If