View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Set a cell from another worksheet

Hi Greg

You need a little more code to make it work, and double qutation signs.

Have a look at this:

With Workbooks("Book1.xls")
MyValue = .Sheets(1).Range("B1").Value
End With
Range("A99") = MyValue

Regards,

Per

"Greg" skrev i meddelelsen
...
This should be VERY simple. I'm trying to code VBA for the first time,
and I
get a syntax error on the below statement. From all the tutorials I read,
this should work.
any clue?

Range(a99) ='[Book1.xls]Sheet1'!$B$1