그런 어리석은 질문에 대해 유감스럽게 생각합니다. 나는 프로그래머가 아니며 인터넷을 통해 발견 한 비트로 매크로를 만들고 있습니다. 단지 코드의 라인의 쿠페와 함께 떠났을 때 나는 대답을 얻을 수 없다.Excel VBA는 조건부 형식 지정을위한 수식으로 다른 셀의 값을 사용합니다.
조건부 작성 비트를 제외하고 매크로에 필요한 모든 작업을 수행했습니다. 것은 내가 현재 가지고있는 셀 위의 4 행의 값보다 큰 셀에 형식 (녹색 셀)을 적용한 다음 다른 형식 (적색 셀)을 낮은 값의 셀에 적용하는 것입니다. 같은 셀 (위의 4 행)의 값이 무엇이든간에이 값은 음수가되어야합니다.
문제는 제가 매크로에 서있는 셀의 4 행보다 위에있는 값을 찾는 방법을 알지 못한다는 것입니다. 그리고 한 번 마쳤습니다. 매크로를 사용하여 기호를 변경하는 방법을 알려줍니다. (-1을 곱하면)
여기에 문제가있는 코드 조각이 있습니다. 당신이 볼 수 있듯이
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561798
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
, 나는 Formula1을 떠 났어요 : 빈, 나는 4 개의 셀 나는
에있어 하나의 위의 값을 찾기 위해 매크로를 얘기하고 싶은 곳이다 다음 수식 1 : 비어있는 셀은 4 셀 위의 셀 값을 찾은 다음 -1로 값을 변경하거나 값을 음수로 변경하는 데 걸리는 모든 값을 필요로합니다.
여기에서 나를 도울 수 있기를 바랍니다. (내 기본 언어가 아닌 영어와 빈약 한 맞춤법을 유감스럽게 생각합니다.)
의 중복 가능성 http://stackoverflow.com/questions/10802281/excel-vba-conditional-formatting-based-on-next-cell-value) – StorymasterQ