AppleScript&Excel:根据variables设置范围

我是一个AppleScript新手,几乎完成了一个脚本来获取电子表格,并将其格式化为一个FileMaker数据库。 这个电子表格是捐助者的月度报表,我只想从中提取捐款。 在捐赠logging下面,我需要删除一些导入列中的一些会计信息,以便干净地导入数据。

这里是完整的脚本:

tell application "Microsoft Excel" activate set theWorkbook to open workbook workbook file name "File Path" --Open the file that contains the DonorId for all Donors set theWorkbook to open workbook workbook file name "File Path" --Open the Monthly Transaction Report set myrange_1 to range ("A1:E4") delete myrange_1 tell worksheet "Transaction Report" of active workbook set value of cell "A1" to "DonorID" autofit columns of range "A1:A100" set lastRow to ((count of rows of used range of active sheet) - 13) set myRange_2 to range ("A2:A" & lastRow) of active sheet set formula of myRange_2 to "=VLOOKUP($C$2:$C$100,'[Donor ID.xlsx]Sheet1'!$A$1:$B$60, 2, FALSE)" set value of cell "F1" to "Donation Method" set myRange_3 to range ("F2:F" & lastRow) of active sheet set formula of myRange_3 to "=IF(D2=\"\",\"Check\", IF(D2=\"CC\",\"Credit Card\", IF(ISNUMBER(SEARCH(\"E\",D2)),\"EFT\",\"#N/A\")))" try set myRange_2 to find what "#N/A" look at whole with match case on error log ("No matches found") end try if (myRange_2 is not "") then display dialog "New Donor @ " & (get address of the cells of myRange_2) end if set myRange_4 to range ("A" & lastRow + 1) set myRange_5 to range ("F" & lastRow + 13) end tell end tell 

一切都很好,除了我找不到一种方法来使用variables来设置要删除的单元格的范围。 这个范围是从lastRow +1到lastRow +13的第1列到第5列。 我试图设置一个基于“myRange_4:myRange_5”的范围,但我无法得到它的工作。 任何帮助将不胜感激!

这是解决scheme

 set rangeToDelete to range ("A" & (lastRow + 1)) & “:F” & ( lastRow + 13)