如果另一个 Cell = TRUE,则将 InputBox 的结果写入一个 Cell
Write the result of an InputBox on a Cell if another Cell is = TRUE
如果单元格 C4 的文本为 "TRUE".
,我希望下面的代码在单元格 L14 上写入 InputBox
的结果
Sub dele()
myValue4 = InputBox("What's the number?")
If Range("C4").Value = "TRUE" Then
Range("L14").Value = myValue4
End If
好像不行。有什么想法吗?
文本条件区分大小写。因此试试这个:
If Ucase(Range("C4").Value) = "TRUE" Then
但是,如果您在 Range("C4") 中只有一个布尔值,这也应该有效:
If Range("C4").Value = True Then
如果单元格 C4 的文本为 "TRUE".
,我希望下面的代码在单元格 L14 上写入InputBox
的结果
Sub dele()
myValue4 = InputBox("What's the number?")
If Range("C4").Value = "TRUE" Then
Range("L14").Value = myValue4
End If
好像不行。有什么想法吗?
文本条件区分大小写。因此试试这个:
If Ucase(Range("C4").Value) = "TRUE" Then
但是,如果您在 Range("C4") 中只有一个布尔值,这也应该有效:
If Range("C4").Value = True Then