VBA Excel : Cells.formule
Bushinone
Posted messages
8
Status
Membre
-
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 ^^ !
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