본문 바로가기
반응형

Range object27

[Range 개체] Find메서드 Find메서드는 찾기 명령을 매크로 기록하면 볼 수 있습니다. Sub Macro1() ' ' Macro1 Macro ' ' Cells.Find(What:="Halle Lester", After:=ActiveCell, LookIn:=xlFormulas2, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate End Sub 문법은 다음과 같습니다. Syntax expression.Find (What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte, SearchFormat).. 2023. 7. 4.
[Range 개체] Clear 관련 메서드 VBA에는 Clear 관련해서 다양한 메서드가 있습니다. Range("A1").CurrentRegion.Clear 이 명령은 메뉴에서 Clear All을 누른것과 같습니다.(전부 삭제) 매크로 실행 전 매크로 실행 후 Range("A1").CurrentRegion.ClearComments 메뉴에서 Clear Comments and Notes를 누른것과 같습니다.(메모 삭제) 매크로 실행 전 매크로 실행 후 Range("A1").CurrentRegion.ClearContents 위 구문은 내용만 삭제합니다. 매크로 실행 전 매크로 실행 후 Range("A1").CurrentRegion.ClearHyperlinks 모든 하이퍼링크를 삭제합니다.(엑셀 2010부터 지원됩니다) Range("A1").Curren.. 2023. 7. 3.
[Range 개체] Borders속성,BorderAround 메서드 - 테두리 서식 설정하기 Range개체의 Borders속성을 이용하면 셀의 테두리를 설정할 수 있습니다. 아래 링크는 도움말입니다. Range.Borders property (Excel) Office VBA reference topic learn.microsoft.com Returns a Borders collection that represents the borders of a style or a range of cells (including a range defined as part of a conditional format). 번역하면 다음과 같습니다. 스타일 또는 셀 범위(조건부 서식의 일부로 정의된 범위를 포함)의 테두리를 나타내는 Borders 컬렉션을 반환합니다. 아래 그림은 Borders개체의 속성입니다. Bord.. 2023. 7. 2.
[Range 개체] Interior속성 Interior속성을 이용해 셀 내부의 서식을 변경할 수 있습니다. Range.Interior property (Excel) Office VBA reference topic learn.microsoft.com 도움말에는 다음과 같은 내용이 있습니다. 지정된 객체의 내부를 나타내는 Interior 객체를 반환합니다 . 이전글(Font속성)에서도 쓴 것처럼 해당 개체의 속성을 사용할 수 있다는 뜻입니다. 아래 그림은 Interior개체의 속성입니다. 도움말 내용처럼 Interior 속성을 통해 Interior 개체에 접근하는 것을 볼 수 있습니다. 배경색을 변경하는 간단한 예제입니다. Sub ChangeCellInteriorColor() Dim rng As Range Set rng = Range("A1") .. 2023. 7. 1.
반응형