Serveira
Serveira

Reputation: 51

Write the result of an InputBox on a Cell if another Cell is = TRUE

I want the below code to write the result of an InputBox on the cell L14 if the cell C4 has the text "TRUE".

    Sub dele()

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

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

    End If

Doesn't seem to work. Any ideas?

Upvotes: 1

Views: 27

Answers (1)

Kazimierz Jawor
Kazimierz Jawor

Reputation: 19077

Text conditions are case sensitive. Therefore try with this:

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

However, if you have just a boolean value in Range("C4") this should also work:

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

Upvotes: 1

Related Questions