0

I have this code:

If cells(3,11).value="c:users\flap-fis.txt"

This condition is getting failed every time either we have file location of or not.

How can I write the code how to check specific cell value with static string?

4
  • celles should be cells. Also specify in which worksheet this cell is eg. Worksheets("Sheet1").Cells(3, 11) Commented Jun 4, 2020 at 11:16
  • Oops typo mistake ..but it is same cells still not working Commented Jun 4, 2020 at 11:18
  • 2
    "Not working" is no error description. Did you specify a worksheet for Cells? Note that your path is missing a backslash ` \` right after c: it should be "c:\users\flap-fis.txt" Commented Jun 4, 2020 at 11:20
  • Voted to close as "Needs Detail or Clarity". Commented Jan 7, 2022 at 21:42

1 Answer 1

1

Do you know how to debug VBA projects? Best thing to do for such a case is putting a breakpoint on that particular line and use the "immediate" window, where you can ask ? <var> in order to know the value of a variable, as in these examples:

? Cells(3, 11).Value = "c:users\flap-fis.txt"
False

? Cells(3, 11).Value
c:\users\flap-fis.txt
=> Mind the extra backslash, as already mentioned by PEH.
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.