[INDENT]Hello everyone, I'm trying to create a button (lets call it "CALCULATE") placed on sheet2 to run a code to color all the reference cells from sheet2 to sheet1, sheet3, sheet4...etc and also exclude sheet2 from the code...
Thanks!
Code
Sub Botón1_Haga_clic_en()Private Sub Worksheet_Calculate() 'apply cells colors from single-cell formula dependencies/links Dim Cel As Range Dim RefCel As Range On Error Resume Next For Each Cel In ActiveSheet.UsedRange If Cel.HasFormula Then Set RefCel = Evaluate(Mid(Cel.Formula, 2)) Cel.Interior.Color = RefCel.Interior.Color End If Next CelEnd SubEnd Sub
[/INDENT]