[사무용 엑셀 매크로] 사각형 그리기 #2 (알록달록 사각형들 그리기)
사각형 그리기 #2 알록달록 사각형들 그리기 일정한 크기,개수의 여러 색깔의 사각형을 그리는 코드 알록달록 사각형 그리기 풀코드 Sub 알록달록사각형() Set rect = ActiveSheet.Range("b2") For X = 20 To 120 Step 10 For Y = 20 To 120 Step 10 ActiveSheet.Rectangles.Add(rect.Left + Y, rect.Top + X, 8, 8).Select Selection.Interior.ColorIndex = Int(Rnd * 56) Next Y Next X End Sub 코드 설명 Set rect = ActiveSheet.Range("b2") B2로 기본 사각형의 위치를 설정 *기본 사각형의 위치를 변경하고싶으면 ("b2") ..
2021.02.28