Excel 2010 VBA Error 1004 with formula
12,648
There are two options for you:
- use
.FormulaLocal
property:wks.Cells(z, "K").FormulaLocal = fZeit
- use comma
,
as separator instead of semicolon;
(even if your local settings require;
as standard separator):
fZeit = "=IF(ISBLANK(H" & z & "),((A" & z & "*B" & z & "*I" & z & ")-I" & z & ")+(A" & z & "*B" & z & "*J" & z & "),(A" & z & "*B" & z & "*H" & z & "))"
wks.Cells(z, "K").Formula = fZeit
Author by
bumblebeeman
Updated on June 11, 2022Comments
-
bumblebeeman almost 2 years
I have this code:
Dim fStrecke As String fStrecke = "=A" & z & "*B" & z & "*C" & z wks.Cells(z, "L").Formula = fStrecke Dim fZeit As String fZeit = "=IF(ISBLANK(H" & z & ");((A" & z & "*B" & z & "*I" & z & ")-I" & z & ")+(A" & z & "*B" & z & "*J" & z & ");(A" & z & "*B" & z & "*H" & z & "))" wks.Cells(z, "K").Formula = fZeit
The first formula is working and for the second i get an runtime error 1004. any idea? i have formatted the column K as user defined with "m:ss".
-
BjörnBogers over 7 yearsWhat a joke! I've been looking for this solution for quite a time .. The separator from my local settings is
;
so that's what I used in my code..