수요일, 06 10 월 2021
  3 답글
  7.2K 방문
0
투표
취소
방금 Excel에서 선택한 영역의 테두리만 복사하는 옵션을 찾고 있었기 때문에 Excel용 Kutools를 구입했습니다. 대상 영역의 내용, 서식, 열 너비는 변경되지 않은 상태로 유지됩니다.

이 웹 페이지에서 Excel용 Kutools를 사용하여 이에 대한 해결책을 찾았습니다.
https://www.extendoffice.com/documents/excel/4336-excel-copy-borders-only.html#a1 

이제 제안된 매크로를 사용하려고 시도했지만 약속된 내용이 전혀 수행되지 않는다는 것을 발견했습니다.
테두리를 복사하는 것 외에도 다음과 같은 기능도 있습니다.
- 목적지 영역에서 서식을 삭제합니다.
- 목적지 지역의 컬럼을 변경합니다.
게다가 매크로는 매우 느리게 작동하며 변경 사항을 취소할 수 없습니다.

매크로가 약속된 대로 작동하는지 확인하도록 도와주실 수 있나요....?

너에게 듣기를 바래

베스트셀러
마리안
0
투표
취소
안녕하세요 MariannevanLubek님,

문제를 일으켜서 미안 해요. 여기에 해당 사례에 대한 또 다른 매크로를 작성했습니다. 시도해 볼 수 있나요?

Sub CopyBorders()
Dim xRg, yRg As Range
On Error Resume Next

Set xRg = Application.InputBox("Select Range with Borders to Copy...", "Kutools For Excel", , , , , , 8)
Set yRg = Application.InputBox("Select Cells to Apply Borders to range..", "Kutools For Excel", , , , , , 8)

With yRg.Borders(xlEdgeLeft)
.LineStyle = xRg.Borders(xlEdgeLeft).LineStyle
.ColorIndex = xRg.Borders(xlEdgeLeft).ColorIndex
.TintAndShade = xRg.Borders(xlEdgeLeft).TintAndShade
.Weight = xRg.Borders(xlEdgeLeft).Weight
End With
With yRg.Borders(xlEdgeTop)
.LineStyle = xRg.Borders(xlEdgeTop).LineStyle
.ColorIndex = xRg.Borders(xlEdgeTop).ColorIndex
.TintAndShade = xRg.Borders(xlEdgeTop).TintAndShade
.Weight = xRg.Borders(xlEdgeTop).Weight
End With
With yRg.Borders(xlEdgeBottom)
.LineStyle = xRg.Borders(xlEdgeBottom).LineStyle
.ColorIndex = xRg.Borders(xlEdgeBottom).ColorIndex
.TintAndShade = xRg.Borders(xlEdgeBottom).TintAndShade
.Weight = xRg.Borders(xlEdgeBottom).Weight
End With
With yRg.Borders(xlEdgeRight)
.LineStyle = xRg.Borders(xlEdgeRight).LineStyle
.ColorIndex = xRg.Borders(xlEdgeRight).ColorIndex
.TintAndShade = xRg.Borders(xlEdgeRight).TintAndShade
.Weight = xRg.Borders(xlEdgeRight).Weight
End With
With yRg.Borders(xlInsideHorizontal)
.LineStyle = xRg.Borders(xlInsideHorizontal).LineStyle
.ColorIndex = xRg.Borders(xlInsideHorizontal).ColorIndex
.TintAndShade = xRg.Borders(xlInsideHorizontal).TintAndShade
.Weight = xRg.Borders(xlInsideHorizontal).Weight
End With
With yRg.Borders(xlInsideVertical)
.LineStyle = xRg.Borders(xlInsideVertical).LineStyle
.ColorIndex = xRg.Borders(xlInsideVertical).ColorIndex
.TintAndShade = xRg.Borders(xlInsideVertical).TintAndShade
.Weight = xRg.Borders(xlInsideVertical).Weight
End With
End Sub


다른 궁금한 점이 있으면 언제든지 문의해 주세요.

아만다
0
투표
취소
안녕하세요 MariannevanLubek님,

한 가지 말씀드리고 싶은 점은 코드를 실행한 후 아래 스크린샷처럼 테두리를 적용하려는 모든 셀을 선택해야 하지만 하나의 셀이 아닌 모든 셀을 선택해야 한다는 것입니다.
셀 선택.png

아만다
첨부 파일 (1)
0
투표
취소
감사합니다. 그동안 문제는 다른 방법으로 해결되었습니다.
  • 페이지 :
  • 1
이 게시물에 대한 답변이 없습니다.