View Single Post
  #5   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


Try to change: If
Workbooks("optvol.xlsx").Sheets("optvol").Range("A 10") = "put" Then

Range("c4") = "it works"
to:
If Workbooks("optvol.xlsx").Sheets("optvol").Range("A 10") = "put" Then
Activesheet.Range("c4") = "it works"

That works for a simillar test here.

PS: To find out how to perform tasks in Excel via VBA, you can record
a macro while doing the stuff manually in Excel, and the check the
recorded code.

I can recommend John Walkenbach "Power programming with VBA".
--
Jesper Kaas -


Many thanks Jesper. Is the Walkenbach book appropriate for beginners like myself?

Again, your help is greatly appreciated.