1
저는 AppleScript 초보자이며 스프레드 시트를 가져 와서 FileMaker 데이터베이스로 가져 오기위한 형식을 지정하는 스크립트를 거의 완성했습니다. 이 스프레드 시트는 월간 기부자 성명서로 기부금 만 추출합니다. 기부 기록 아래에 데이터를 깨끗하게 가져 오기 위해 제거해야하는 일부 가져 오기 항목에 회계 정보가 있습니다.AppleScript 및 Excel : 변수를 기반으로 범위 설정
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
모든 내가 삭제할 셀 범위를 설정하는 변수를 사용하는 방법을 찾을 수없는 것을 제외하고, 좋은 작품 : 여기에
은 전체의 스크립트입니다. 이 범위는 lastRow + 1에서 lastRow +13까지 1 열에서 5 열까지입니다. "myRange_4 : myRange_5"를 기준으로 범위를 설정하려고했지만 작동하도록 설정할 수 없습니다. 어떤 도움이라도 대단히 감사하겠습니다!
는 질문에 게시 할 수있는 스크립트에 더 이상 코드가 있나요입니까? :) – summea
전체 스크립트를 편집하여 게시했습니다. – pnomads
이제 명확히하기 위해 _A.lastRow + 1_과 _F.lastRow + 13_ 사이의 모든 열 (및 해당 행)을 선택하려고하지만 범위가 아닙니다. 이 시점에서 _A_ 및 _F_ 열만 선택 되었기 때문에 선택됩니까? – summea