2016-08-13 3 views
-2

이 통합 문서를 열면 여러 통합 문서에 대한 링크를 만드는 수식을 쓰는 다음 스크립트가 실행됩니다. 각각의 통합은이 vba 스크립트의 속도 향상

WBNAME = "=IF(AND('\\insurance\it\FileData\Computers\Release Note\[Aliens.xlsm]iForms'!A2<>"""",'\\insurance\it\FileData\Computers\Release Note\[Aliens.xlsm]iForms'!E2=""""),'\\insurance\it\FileData\Computers\Release Note\[Aliens.xlsm]iForms'!A2,"""")" 
Worksheets("All Release Items").Range("A2:A100").Value = WBNAME 
WBNAME2 = "=IF(AND('\\insurance\it\FileData\Computers\Release Note\[Aliens.xlsm]iForms'!A2<>"""",'\\insurance\it\FileData\Computers\Release Note\[Aliens.xlsm]iForms'!D2<>"""",'\\insurance\it\FileData\Computers\Release Note\[Aliens.xlsm]iForms'!E2=""""),'\\insurance\it\FileData\Computers\Release Note\[Aliens.xlsm]iForms'!D2,"""")" 
Worksheets("All Release Items").Range("B2:B100").Value = WBNAME2 
WBNAME3 = "=IF('\\insurance\it\FileData\Computers\Release Note\[Aliens.xlsm]All Release Items'!A2<>"""",'\\insurance\it\FileData\Computers\Release Note\[Aliens.xlsm]All Release Items'!A1,"""")" 
Worksheets("All Release Items").Range("C2:C100").Value = WBNAME3 

은 모든 .xlsm과 같은 파일에 위치한 12 개 개의 통합 문서있다 .. 통합 1은 A, B 및 C에 기록하고 통합 2 D, E, F 등을 기록, 즉 3 개 컬럼에 쓴다 통로. 도와주세요

답변

0

문제의 일부는 응용 프로그램 세션에서 열려 있지 않은 참조 통합 문서로 수식을 업데이트해야한다는 것입니다. 통합 문서가 열리면 수식이 입력되는 것이 더 빠를 것입니다.

계산 모드를 수동 ("수식"리본 페이지의 "계산"섹션 또는 Application.Calculation = xlCalculationManual)으로 설정 한 다음 매크로를 실행 한 다음 "지금 계산"(리본에서 다시, 또는 F9), 소요 시간을 확인하십시오. 참조 된 통합 문서가 열린 상태와 닫힌 상태를 비교하여 실행 시간을 비교하십시오. 내 생각 엔 매크로가 수식을 추가하는 데 약간의 시간이 걸리 긴하지만 통합 문서가 닫혀 있기 때문에 계산에 많은 시간이 걸리는 것으로 나타났습니다.

이 경우 다시 계산하여 계산하기 전에 통합 문서를 엽니 다.

또한 데이터베이스를 참조해야하는 경우 데이터를 데이터베이스에 저장하는 것이 좋습니다.