Using Formulae in Macros

  • Thread starter Thread starter DDONNI
  • Start date Start date
D

DDONNI

Hi guys, can anyone help me with this problem i have, i'm using th
folling formula:

=SUM(IF(('Full Table'!$AF$2:$AF$6000="Baby Care")*('Ful
Table'!$AG$2:$AG$6000="Goods"),'Full Table'!$AE$2:$AE$6000))

To get this formula to work though i have to do CTRL SHIFT and ENTER.

The problem is i like to use my formulae in my macros so theres never
formula just sitting in the workbook to try and save on space using th
following command line:

Worksheets("Full Table").Range("H2").Value = _

"=IF(ISERROR(VLOOKUP(G2,Requisitioners!$A$2:$E$155,2,FALSE)),"""",(VLOOKUP(G2,Requisitioners!$A$2:$E$155,2,FALSE)))"

But if i try this command with the above formula it doesn't wor
because of the CTRL SHIFT ENTER and if i try using {} around th
formula it doesn't work either.

Can someone please help me with this please?

Cheers,

Donni.

:confused
 
Hi
try:
Worksheets("Full Table").Range("H2").formulaarray= _

"=IF(ISERROR(VLOOKUP(G2,Requisitioners!$A$2:$E$155,2,FALSE)),"""",(VLOOKUP(G2,Requisitioners!$A$2:$E$155,2,FALSE)))"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top