Use isso na folha de çodigo da própria planilha, e não da "EstaPastadeTrabalho"...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim wks As Excel.Worksheet
Dim rngX As Excel.Range
Dim rngNumber As Excel.Range
Dim lngNumbersCol As Long
Set wks = Target.Parent
If Not VBA.TypeName(wks) = "Worksheet" Then Exit Sub
If Application.Intersect(wks.Range(gcstrX), Target) Is Nothing Then Exit Sub
If VBA.LCase(Target.Value) <> "x" Then Exit Sub
lngNumbersCol = wks.Range(gcstrNumbers).Column
Application.EnableEvents = False
With wks
For Each rngX In wks.Range(gcstrX)
If .Cells(rngX.Row, lngNumbersCol) = .Cells(Target.Row, lngNumbersCol) Then
.Cells(rngX.Row, lngNumbersCol).Interior.Color = vbYellow
If .Cells(rngX.Row, lngNumbersCol) = .Cells(Target.Row, lngNumbersCol) Then
.Cells(rngX.Row, lngNumbersCol).Font.Color = vbYellow
End If
End If
Next rngX
End With
Set wks = Nothing
Application.EnableEvents = True
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 30/07/2014 6:26 pm