Hi
Is it posable to insert a variable into a formula? I’ve been trying to with no success for weeks. Going in circles now.
Here is 1 of the scripts I could use a variable for.
repeat 1 times --serval hundred
tell application "Microsoft Excel" --copies formulas
activate
activate object worksheet "Sheet1 (2)" of active workbook
set dr1 to (get value of cell "g1") --values to add in sheet1
set dr2 to (get value of cell "h1")
set dr3 to (get value of cell "i1")
set dr4 to (get value of cell "j1")
set dr5 to (get value of cell "k1")
delete range range "a1:k1" shift shift up
activate object worksheet "Sheet1" of active workbook
set formula of cell "AG3" to "=t3+u3+v3+aa3+ab3" --need variables here,these are dr1 to 5
set sourceRange to range "AG3" of sheet "Sheet1"
set destRange to range "AG4:AG500" of sheet "Sheet1"
copy range sourceRange destination destRange --applies formula to range
set formula of cell "AH2" to "=COUNTIF(AG3:AG500,0)"
set formula of cell "AI2" to "=COUNTIF(AG3:AG500,1)"
set formula of cell "AJ2" to "=COUNTIF(AG3:AG500,2)"
set formula of cell "AK2" to "=COUNTIF(AG3:AG500,3)"
set formula of cell "AL2" to "=COUNTIF(AG3:AG500,4)"
set formula of cell "AM2" to "=COUNTIF(AG3:AG500,5)"
set formula of cell "AN2" to "=COUNTIF(AG3:AG500,6)"
copy range range "AG2:AN2" of worksheet "Sheet1" of active workbook
activate object worksheet "Sheet2" of active workbook
set TargetRange to column 1 of the active sheet
set AfterCell to cell "A1" in the active sheet
set FoundRange to find TargetRange what "" after AfterCell look in values look at whole search direction search next
select FoundRange
set pasteRange to (get address of FoundRange)
paste special (range pasteRange) what paste values--transfer data to
end tell
end repeat
Any ideas?
Thanks
bills