Q about settings and commands in Excel 2013

Robin121

Board Regular
Joined
May 6, 2011
Messages
51
Hi guys,

--using Excel 2013
--VBA 7.1
--dutch language

By clicking a button, I would like to paste a formula into a cell that either fills the cell based on the result of the formula, or leaves it empty.
For that, I use:

Sheets("DSS voorafgaand aan competitie").Select
Worksheets("DSS voorafgaand aan competitie").Range(BS7).Formula = "=ALS(BP7="";"";VERT.ZOEKEN(BP7;Kladblok!BP7:DO16;4))"
--(more rows)--


which results in the error:

"Error 1004 during execution"
"Application or object defined error"

I then tried the work-around with a loop:

Dim k as Integer
k = 7
Do Until k = 17
Worksheets("DSS voorafgaand aan competitie").Cells(k, 73).FormulaR1C1 = "=IF(RC[-5]="""","""",VLOOKUP(RC[-5],Kladblok!R7C68:R16C119,6))"
--other rows--
k = k + 1
Loop

That works fine. But why does VBA only understand the R1C1 structure and commands in english? My Excel is set to dutch..?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
In the first attempt you need to enclose the range in quotes "BS7", you also need to double up on the quotes in the formula.
Not sure if you need to replace the ; with ,
 
Upvote 0
Maybe this

Code:
Worksheets("DSS voorafgaand aan competitie").Range(BS7).[COLOR=#ff0000]FormulaLocal[/COLOR] = "=ALS(BP7=[COLOR=#ff0000]""""[/COLOR];[COLOR=#ff0000]""""[/COLOR];VERT.ZOEKEN(BP7;Kladblok!BP7:DO16;4))"

M.
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top