View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
programmernovice[_2_] programmernovice[_2_] is offline
external usenet poster
 
Posts: 61
Default VBA Does not recognize cell contents

I have a workbook "Optvol" having the word "put" in cell A10. In a macro:

If Workbooks("optvol.xlsx").Sheets("optvol").Range("A 10") = "put" Then

Range("c4") = "it works"

End If

C4 is in the active workbook, different from "Optvol". Nothing happens upon execution, and there is no error message

Clearly, for some reason the contents of Optvol A10 are not recognized.

Any idea what I'm doing wrong? Appreciate all help, thanks.