lundi 1 août 2016

VBA Excel if Cell Is Not Equal to formula then

I want to check if a cell is this formula then execute a part 2 script

The code Simplified

Range("B1:C1").Select
If ActiveSheet.Name = "Sheet1" And ActiveCell <> "=formula1" Then Sheet1Macro

the complete code (long)

Range("B1:C1").Select
If ActiveSheet.Name = "Sheet1" And ActiveCell <> "=IF(OR(IFERROR(SEARCH(""DKB"",RC[-2]),0),IFERROR(SEARCH(""Cox"",RC[-2]),0),IFERROR(SEARCH(""2020"",RC[-2]),0)),RC[-1],"""")" Then Sheet1Macro

I'm just asking on how to check if the cell is a formula because I insert rows and that changes the formula from A2:F99 to A99:F189 for example

Aucun commentaire:

Enregistrer un commentaire