Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EXCEL VBA run formula via MACRO

Tags:

excel

vba

formula

I had already asked a question like this before but I'm really bad at VBA formula.

Here is my formula:

Worksheets("Sheet1").Range(CellRange).formula = "=IF(Sheet2!E$4=X;CONCATENATE(Sheet3! """ & myString """, Not defined)"

Run-time error 1004: error defined by the application or object

myString is a STRING and contains the address of a cell.

I've used to follow the explanation from my previous question A question with a really good answer

But It didn't worked this time. Any suggestions?

Thank you!


1 Answers

Worksheets("Sheet1").Range(cellrange).Formula = _
  "=IF(Sheet2!E$4=""X"",Sheet3!" & myString & ", ""Not defined"")"
like image 137
Mesut Akcan Avatar answered Feb 02 '26 02:02

Mesut Akcan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!