how to use tab[column header] in VBA

Tahitipit

New Member
Joined
Feb 3, 2015
Messages
5
Hi,

I have the following formula in VBA which works fine
Worksheets("TRANSPORT").Range("ZONEFRET[Amount in local Currency]").Formula = "=IF(OR(B17="""",C17="""",D17="""",E17="""",F17=""""),"""",MIN(H17,MAX(C17*F17,G17)))"

But instead of using cell references I would lile to use tab[column header]

Here the fomula in excel format
=IF(OR(ZONEFRET[@Description]="",ZONEFRET[@QTY]="",ZONEFRET[@Unit]="",ZONEFRET[@Currency]="",ZONEFRET[@[Unite Price]]=""),"";MIN(ZONEFRET[@Max],MAX(ZONEFRET[@QTY]*ZONEFRET[@[Unite Price]],ZONEFRET[@Min])))

The syntaxe seems to be differente in VBA , how can I write that formula in VBA ?

Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
The macro recorder will give you the correct syntax.

Select any cell with the formula.
Start the macro recorder.
Press F2.
Press Enter.
Stop the macro recorder.

It should be as simple as doubling up on the double quotes, the same as you would with a regular formula
"=IF(OR(ZONEFRET[@Description]="""",ZONEFRET[@QTY]="""",ZONEFRET[@Unit]="""",ZONEFRET[@Currency]="""",ZONEFRET[@[Unite Price]]=""""),"""";MIN(ZONEFRET[@Max],MAX(ZONEFRET[@QTY]*ZONEFRET[@[Unite Price]],ZONEFRET[@Min])))"

But the single semi-colon in the formula is making me doubt that the formula syntax is valid.
 
Upvote 0

Forum statistics

Threads
1,216,818
Messages
6,132,879
Members
449,765
Latest member
Coffebreak

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