POINT
주요 오류
개선 고려해볼 것
Option Explicit
Sub get_From_Closed_File()
' //변수 정의
Dim strPath As String
Dim fileName As String
Dim shtName As String
Dim rngAll As Range
Dim rngC As Range
' // 대상 엑셀파일의 경로 지정
shtName = "test"
strPath = "C:\Users\사용자\Desktop\"
fileName = "Book2.xlsx"
Set rngAll = Range("A1:C7")
' // rangeAll 내 속하는 모든 셀에 접근하여, ActiveCell에 1개씩 값을 옮김.
For Each rngC In rngAll
rngC.Formula = "='" & strPath & "[" & fileName & "]" & shtName & "'!" & rngC.Address
rngC = rngC.Value 'rngC의 식을 불러온 것을 값으로 변환.
Next rngC
' //range 초기화(개체변수 초기화)
Set rngAll = Nothing
End Sub
[Python] csv를 1개의 엑셀 파일로 합치기 (0) | 2022.06.06 |
---|---|
[Python] 오늘자 인벤 기사 추출하는 프로그램 with PyQt (0) | 2020.07.26 |
[Python] PyQt로 UI 출력하기 (0) | 2020.07.22 |
[VBA] Json 형식의 문자열을 데이터테이블화 (0) | 2019.12.20 |
댓글 영역