Excel의 특정 열에 따라 색상 추가
4360 단어 Excel
1: Sub Macro1() 2: Dim i As Integer 3: Dim x As String 4: For i = 1 To Sheet1.UsedRange.Rows.Count 5: With Sheet1.Rows(i).Interior 6: x = Cells(i, 3) 7: If x = " " Then 8: Call Macro2(i, 3, 15773696) 9: ElseIf x = " " Then 10: Call Macro2(i, 3, 5296274) 11: End If 12: End With 13: Next 14: End Sub 15: 16: Sub Macro2(x As Integer, y As Integer, colorIndex As Long) 17: Range(Cells(x, y), Cells(x, y)).Select 18: With Selection.Interior 19: .Pattern = xlSolid 20: .PatternColorIndex = xlAutomatic 21: .color = colorIndex 22: .TintAndShade = 0 23: .PatternTintAndShade = 0 24: End With 25: Range("G18").Select 26: End Sub 27: 28: 29: 30: Sub Macro1() 31: Dim i As Long 32: Dim x As String 33: Columns(3).Interior.ColorIndex = xlNone 34: For i = 1 To Sheet1.UsedRange.Rows.Count 35: With Sheet1.Rows(i).Interior 36: x = Cells(i, 3) 37: If x = " " Then 38: Cells(i, 3).Interior.ColorIndex = 5 39: End If 40: End With 41: Next 42: End Sub .csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Excel Grep toolExcel Grep tool ■히나가타 ■ 시트 구성 ExcelGrep.cls...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.