如何根据excel中的相邻单元格设置持续时间类型的数据条

How to set data bar of type duration based on the adjacent cells in excel

我是excel的新手,我只是想知道如何根据相邻单元格[=28=设置数据栏 ].

当我尝试这样做时,它说不允许多个单元格条件格式中不允许相对单元格

我通过一个一个地设置数据栏做到了。但我只是想知道是否有任何简单的方法可以将其应用于大块数据。

请参考下图

在此图像中,COMPLETED 行中的所有单元格均指代 TODO 的第一个元素,即 8:00:00。我希望将其设置为自己的相邻单元格。

如我的评论所述,您将获得一个宏,其中包含(或多或少):

    With Selection.FormatConditions(1)
        .MinPoint.Modify newtype:=xlConditionValueAutomaticMin
        .MaxPoint.Modify newtype:=xlConditionValueNumber, newvalue:= _
        "=$C"
    End With

您可以将其更改为:

    With Selection.FormatConditions(1)
        .MinPoint.Modify newtype:=xlConditionValueAutomaticMin
        .MaxPoint.Modify newtype:=xlConditionValueNumber, newvalue:= _
        "=$C$" + ActiveCell.Row
    End With

(类似的东西)