【问题标题】:Write the result of an InputBox on a Cell if another Cell is = TRUE如果另一个 Cell 为 = TRUE,则在 Cell 上写入 InputBox 的结果
【发布时间】:2016-10-20 11:11:15
【问题描述】:

如果单元格 C4 的文本为“TRUE”,我希望下面的代码在单元格 L14 上写入 InputBox 的结果。

    Sub dele()

    myValue4 = InputBox("What's the number?")

    If Range("C4").Value = "TRUE" Then
    Range("L14").Value = myValue4

    End If

似乎不起作用。有什么想法吗?

【问题讨论】:

    标签: excel vba inputbox


    【解决方案1】:

    文本条件区分大小写。因此试试这个:

    If Ucase(Range("C4").Value) = "TRUE" Then
    

    但是,如果您在 Range("C4") 中只有一个布尔值,这也应该可以:

    If Range("C4").Value = True Then
    

    【讨论】:

      猜你喜欢
      • 2021-02-14
      • 1970-01-01
      • 1970-01-01
      • 2017-11-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-04
      • 1970-01-01
      相关资源
      最近更新 更多