Untitled

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

Sub ���õ� ���κ��� ������ ���� ����ϴ� �������� ����()

Worksheets("Sheet1").Range("A1").Select 'Sheet1�� A1 �� ����


If Selection <> "" Then 'A1 ���� ����� �ƴϸ� If ���� ����

MsgBox "�Էµ� ���� ����� ��� ‫�ڽ‬ϴ�"


Selection.ClearContents 'A1 ���� ������ ��� (Clear:����� ���� ���
��� / ClearContents:���븸 ��� / ClearFormats:���ĸ� ���)

End If

Worksheets("Sheet1").Range("A1:A10").Value = " Test " 'A1~A10 ���� Test ���


�Է�
MsgBox "A1:A10 ������ ��� �Է��Ͽ���ϴ�"

End Sub

-----------------------------------------------------------------------------------
--------

Sub WriteData_3()

Worksheets("Sheet1").Range("A1").Select
Range("A1").CurrentRegion.Select 'A1 ���� ����� �ִ� �ֺ� �� ��� ����
MsgBox Selection.Address & "����� �����Ͽ���ϴ�. ��� ��� ‫�ڽ‬ϴ�"

Selection.ClearContents
With Range("A1,A3,A5,A7,A9,B2,B4,B6,B8,B10")
.Select
.Value = "Test"

End With
MsgBox """A1,A3,A5,A7,A9,B2,B4,B6,B8,B10""���� ��� �Է��Ͽ���ϴ�"

End Sub

-----------------------------------------------------------------------------------
--------

! Range ����Ʈ�� �̹
� ���õǾ� �ִ� ���¿��� ����� �� ��ü�� �Ǵ� �� ��ü�� Ȯ���ϴ� ���

Sub Rows_Property_3()

Range("B2:E3").Select
MsgBox "���õ� ����� �� ��ü�� Ȯ��", ,"jkkim@th-net.co.kr"
Selection.EntireRow.Select
MsgBox "���� ����� �� ��ü�� Ȯ�� �Ǿ��ϴ�"
Range("B2:E3").Select
MsgBox "���õ� ����� �� ��ü�� Ȯ��"
Selection.EntireColumn.Select
MsgBox "���� ����� �� ��ü�� Ȯ�� �Ǿ��ϴ�"

End Sub

-----------------------------------------------------------------------------------
--------

Sub CurrentRegion_Property_3()
Range("A1").CurrentRegion.Select
MsgBox "���� ����� �����Ͽ���ϴ�"

Selection.Offset(1,0).Select
MsgBox "���� ���� �߿��� Ÿ��Ʋ �κ�� ����Ͽ���ϴ�"

Selection.Resize(Selection.Rows.Cout- 1, Selection.Columns.Count).Select
MsgBox "��� ��ĥ� �մϴ�"
Selection.Interior.ColorIndex = 44

End Sub

-----------------------------------------------------------------------------------
--------

<Type �μ�>

- xlCelltypeAllFormatConditions : ǥ�� ����� ����Ǿ� �ִ� ��


- xlCelltypeValidations : �ȿ�� ����� ����� ��
- xlCelltypeBlanks : �� ���‫�� �ִ���� ���ڿ‬
- xlCelltypeComments : �޸� ����ִ� ��
- xlCelltypeConstants : ��� ���ԵǾ� �ִ� ��
- xlCelltypeFormulas : ����� ����ִ� ��
- xlCelltypeLastCell : ���� ��� ���� ���� ��
- xlCelltypeSameFormatConditions : ��� ����� ���� ��
- xlCelltypeSameValidation : ��� �ȿ�� ���� ���� ��
- xlCelltypeVisible : ȭ�鿡 ���̴ �(��Ÿ�� �ִ�) ��� ��

<Value �μ�>

- xlErrors : ������
- xlLogical : ����
- xlNumbers : ��� �‫ڰ‬
- xlTextValues : ���‫���ڿ‬

Sub SpecialCells_Method()

ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Select
MsgBox "���� ������ �� �ּҴ�" &Selection.Address & "�̰
� &vbCr & "�Էµ� ���"
&Selection.Value & "�Դϴ�"

End Sub

Sub SpecialCells_Method_2()

Dim rngMyRange As Range


Set rngMyRange = Worksheets("Sheet7").Cells.SpecialCells(xlCellTypeFormulas)

rngMyRange.Interior.ColorIndex = 6 '����
MsgBox "����� �Էµ� ��� ��� ������� ǥ���Ͽ���ϴ�!"

End Sub

-----------------------------------------------------------------------------------
--------

<��������>
- Range("D8").End(xlUp).Select : D8 �� ������� ���� �ִ� ��� �
- Range("D8").End(xlDown).Select : D8 �� ������� ���� �ִ� ��� �Ʒ�
- Range("D8").End(xlToLeft).Select : D8 �� ������� ���� �ִ� ��� ����
- Range("D8").End(xlToRight).Select : D8 �� ������� ���� �ִ� ��� �����

Sub End_Property()

Dim rngStart As Range


Dim strAddress As String
Set rngStart = Sheets("Sheet1").Range("D8")

With rngStart.End(xlUp).Select
strAddress = Selection.Address(rowabsolute:=False,columnabsolut:=False)
MsgBox "D8 ���� ��� �� ���� [" & strAddress & "]��� �����Ͽ���ϴ�"
End With

End Sub

Sub End_Property_2()

Range(Range("A3"), Range("A3").End(xlToRight)).Select
Selection.Interior.ColorIndex = 6
Selection.Font.ColorIndex = 2
MsgBox "A3�� ���� ������ �ִ� ����� �������� ���� ���� �Ϸ�"

End Sub

You might also like