Jump to content
Sign in to follow this  

Excel.Au3 Write Formula question

Recommended Posts



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 ?



The actual formulat that gets written intoi the cell a2 is


#include <IE.au3>

#include <file.au3>

#include <Date.au3>

#include <Array.au3>

#include <Excel.au3>


_ExcelSheetActivate($oExcel_to, "Email_locations")




$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)


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

Share this post

Link to post
Share on other sites


I resolved my issue using the Snippet Below

$oExcel_to.range("E" & $r).select

$oExcel_to.ActiveCell.FormulaR1C1 = "=VLOOKUP(Rc[-2],Email_Locations!R1C1:R3000C3,2,FALSE)"

Share this post

Link to post
Share on other sites

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
Sign in to follow this