셀 값을 나눌 매크로를 만들고 그 값이 7.5 이상이면 셀을 짙은 녹색으로 채우고 계속 색칠을 계속합니다. 후속 셀은 짙은 녹색으로, 예를 들어 2.25는 2 셀 짙은 녹색이고 .25 밝은 녹색입니다. 또한 색칠 할 셀의 색 내용이 회색 인 경우 색이없는 셀에 올 때까지 활성 셀을 계속 움직입니다.원래 셀 값을 기준으로 다른 음영으로 여러 셀에 색 지정
For Each y In rng
If Not IsEmpty(y) And y > 7.5 And y <> "" And IsNumeric(y) Then 'I am having trouble here
y.Select
With ActiveCell.Offset(0, i).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent3
.TintAndShade = -0.249977111117893
.PatternTintAndShade = 0
End With
col = y.Value/7.5
Count = Left(col, Len(col) - InStr(1, col, "."))
For i = 1 To Count
Do While ActiveCell.Offset(0, i).TintAndShade = -0.149998474074526
i = i + 1: Count = Count + 1
Loop
ActiveCell.Offset(0, i).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent3
.TintAndShade = -0.249977111117893
.PatternTintAndShade = 0
End With
Next i
Count = Right(col, Len(col) - InStr(1, col, "."))
If Count > 0 And Count < 25 Then
ActiveCell.TintAndShade = -4.99893185216834E-02
ElseIf Count > 26 And Count < 50 Then
ActiveCell.TintAndShade = 0.799981688894314
ElseIf Count > 75 And Count < 100 Then
ActiveCell.TintAndShade = 0.599993896298105
End If
Next y
End If
Next y
회색조 셀이 주말 인 작업량을 표시하기위한 매크로이므로 건너 뛰면됩니다.
정확히 작동하지 않는 항목은 무엇입니까? – Jordan
만약 IsEmpty가 아니라면 (y) y> 7.5 그리고 y <> ""그리고 IsNumeric (y) 그러면 y가 7.5보다 클 때 클릭하지 않을 것입니다. – Lowpar
@Lowpar 어떻게 정의 되나요? 7.5보다 큰 숫자 값을 얻었습니까? 7.5로 표시되는 문자열이 아닌가? –