■ Computer/ㅡETC
티스토리 VBA 코드 붙여넣기
with seok
2020. 7. 21. 19:01
https://colorscripter.com/ |
컬러스크립터 싸이트로 이동






결과 ↓ 드래그하여 긁어진다!! |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
Sub If_Color()
Dim n_Row As Integer
n_Row = Range("A3")
Dim Data_Rng, Test_Rng As Range
Set Data_Rng = Range("B11:B" & n_Row + 10)
Range("B11").CurrentRegion.Offset(1, 0). _
Interior.ColorIndex = 0
If Range("J16") = "이상" Then
For Each Test_Rng In Data_Rng
If Test_Rng.Offset(0, 1) = Range("J10") _
And Test_Rng.Offset(0, 3) = Range("J12") _
And Test_Rng.Offset(0, 4) >= Range("K14") Then
Test_Rng.Resize(1, 5).Interior.Color _
= Range("J16").Interior.Color
Else
End If
Next
Else
For Each Test_Rng In Data_Rng
If Test_Rng.Offset(0, 1) = Range("J10") _
And Test_Rng.Offset(0, 3) = Range("J12") _
And Test_Rng.Offset(0, 4) <= Range("K14") Then
Test_Rng.Resize(1, 5).Interior.Color _
= Range("J16").Interior.Color
Else
End If
Next
End If
End Sub
|
cs |
728x90