0
아래 코드를 사용하여 매크로를 실행하는 중 오류 메시지가 나타납니다.매크로 실행 중 오류가 발생했습니다.
활성 열에서 일부 셀 서식의 표시 값 을 기본 정밀도 다른 수준을 사용하고 있기 때문에 우리는 값을 입력하지 않은Excel 통합 문서에서 직접 runned
오류 메시지
오류 메시지
런타임 오류가 9 첨자 범위를 벗어난,
VBA 를 통해 runned 때 코드에
는 With Windows("InstData_TEMS_Existing").Sheets("L")
Sub Graph()
'
' Graph Macro
'
' Keyboard Shortcut: Ctrl+e
'
'Select values in a column from specified workbook and sheet
Dim LR As Long, cell As Range, rng As Range
With Workbooks("Area3-LG").Sheets("Graph data")
LR = .Range("B" & .Rows.Count).End(xlUp).Row
For Each cell In .Range("B4:B" & LR)
If cell.Value <> "" Then
If rng Is Nothing Then
Set rng = cell
Else
Set rng = Union(rng, cell)
End If
End If
Next cell
End With
rng.Copy ' copy the union range (no need to select it first)
'Paste without all the selecting
'Error code below
With Windows("InstData_TEMS_Existing").Sheets("L")
' Paste (without select) un the next empty cell fromn column AA
.Range("AA" & .Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End With
Application.CutCopyMode = False
'Go back to previous workbook & delete column
Workbooks("Area3-LG").Sheets("Graph data").Columns("B:B").Delete Shift:=xlToLeft
End Sub
"L"시트가 액티브 워크 북에 있습니까? – QHarr
통합 문서 ("InstData_TEMS_Existing.xlsx")를 사용해 보셨습니까? 시트 ("L")? – sktneer
'Windows ("InstData_TEMS_Existing.xlsx") ...'? ("InstData_TEMS_Existing.xlsx": 1) .Sheets (... ' – BruceWayne