워크 시트의 현재 셀을 가져 오려면 활성화해야한다고 생각하지만 사용자가 포커스 변경을 실제로 인식하지 못하도록 화면 업데이트를 끌 수 있습니다.
아래 코드는 통합 문서의 시트 2에있는 활성 셀의 주소를 가져 와서 디버그 메뉴에 출력하고 커서를 다음 행으로 이동 한 다음 현재 시트로 되돌리고 스왑하기 전에 화면 업데이트 :
난이 도움이되기를 바랍니다, 앤드류
Sub MoveToNextCell()
'Turn off screen updates
Application.ScreenUpdating = False
'Get the active cell in worksheet 2
ThisWorkbook.Sheets(2).Activate
'Execute the movement
Debug.Print "Pre-movement address: " & Application.ActiveCell.Address
ThisWorkbook.ActiveSheet.Cells(Application.ActiveCell.Row + 1, Application.ActiveCell.Column).Select
Debug.Print "Post-movement address: " & Application.ActiveCell.Address
'revert back to the original worksheet
ThisWorkbook.Sheets(1).Activate
'Turn screenupdates back on
Application.ScreenUpdating = True
End Sub
예, 할 수있는 방법이있다. 관련 코드 조각을 포함하도록 질문을 편집하십시오. 또한, [이 참조하십시오] (http://stackoverflow.com/help/on-topic) – ARich
[this] (http://stackoverflow.com/questions/71180/how-can- i-find-last-row-that-that-data-in-the-excel-sheet-with-a-macro도 포함합니다. –