Jump to content

Recommended Posts

Posted

Hello,

When using the code below to write the formula into the cell it does work and create the formula in the cell, however it

is adding in the $ to the cell references so that when the data is sorted the formulas do not reference the correct cells.

How do I force the writeformula to not put in The $ Cell references ?

Thanks

Paul

The actual formulat that gets written intoi the cell a2 is

=IF(ISNA(VLOOKUP($A$2,Scheduled_Reports!$C:$C,1,FALSE)),"NO","YES")

#include <IE.au3>

#include <file.au3>

#include <Date.au3>

#include <Array.au3>

#include <Excel.au3>

$oExcel_to=_ExcelBookOpen("C:\fixme2.xlsx")

_ExcelSheetActivate($oExcel_to, "Email_locations")

$oExcel_to.ActiveSheet.Columns("A:D").AutoFilter

$r=2

Do

$stryn='"' & "NO" & '"' & "," & '"' & "YES" & '"'

;~ MsgBox(4096,"y/n",$stryn)

$Strformula = "=if(isna(VLOOKUP(A" & $r & ",Scheduled_Reports!c3:C3,1,FALSE))," & $stryn & ")"

;~ MsgBox(4096,"formula",$Strformula)

_ExcelWriteFormula($oExcel_to, $Strformula, $r, 4)

$r=$r+1

Until StringLen(_ExcelReadCell($oExcel_to, $r, 3))=0

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...