한 인스턴스에서 한 셀을 참조해야하고 다른 셀에서 한 열을 참조해야하므로 명명 된 범위를 어떻게 통합 할 수 있는지 알지 못합니다.
그럼 당신은 Name
의 범위 속성 작업을 시도해 볼 수도, 다음 등 .Resize
또는 .Offset
, 코드 모양의 단일 셀 부분을 무엇
Sub Test()
'Assume there is a named range in the worksheet
Dim nm As Name
Dim rngName As Range
Dim rngCell As Range
Dim rngColumn As Range
Set nm = ActiveSheet.Names(1)
Set rngName = Range(nm)
MsgBox "myName address: " & rngName.Address
Set rngCell = Range(nm).Resize(1, 1)
MsgBox "the first cell in myRange is " & rngCell.Address
Set rngCell = Range(nm).Resize(1, 1).Offset(3)
MsgBox "the third cell in myRange is " & rngCell.Address
Set rngColumn = Range(nm).EntireColumn
MsgBox "the column of myRange is " & rngColumn.Address
'Now insert a column in front of D
rngName.Insert
'Then view the addresses again, see that they have changed
Set rngName = Range(nm)
MsgBox "myName address: " & rngName.Address
Set rngCell = Range(nm).Resize(1, 1)
MsgBox "the first cell in myRange is " & rngCell.Address
Set rngCell = Range(nm).Resize(1, 1).Offset(3)
MsgBox "the third cell in myRange is " & rngCell.Address
Set rngColumn = Range(nm).EntireColumn
MsgBox "the column of myRange is " & rngColumn.Address
End Sub
같은 일반적인 범위의 방법을 사용할 수 있습니다 현재 좋아해? – Blackhawk
아직 시도한 것이 있습니까? –