VBA Excel : Cells.formule

Bushinone Posted messages 8 Status Membre -  
Bushinone Posted messages 8 Status Membre -
Hello everyone,
I am trying, within a macro, to write a formula in a cell and then spread it across a given range. I proceed as follows:

ThisWorkbook.Sheets(2).Activate
Cells(2, 2).Formula = "=IF(SEARCH(""permission"",TRIM(A2))>4,"""",TRIM(SUBSTITUTE(SUBSTITUTE(A2,""<permission name="" />"","""")))"
Cells(2, 2).AutoFill Destination:=Range("B3:B999"), Type:=xlFillDefault

However, it shows me an error: expected statement.

If someone can help me resolve my problem, I would be very grateful ^^ !
Configuration: Windows XP Firefox 3.0.1

5 réponses

CIAnure Posted messages 44 Status Membre 29
 
On which line is the error raised?

The error: waiting for instruction is to signal a missing parameter if I remember correctly.
Do check your parentheses as well.
Thank you, Best regards, CIAnure
2