View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lars-Inge Tønnessen \(VJ# MVP\) Lars-Inge Tønnessen \(VJ# MVP\) is offline
external usenet poster
 
Posts: 5
Default VBA How do I set a value in a cell?

Hi All Excel experts!

I'm using Excel 2003 Professional Edition.

How do I set a value in a cell from a VBA function. I can't return the value
from the function, it must be entered from VBA code.

I have tried this line:
Range("Sheet1:M5").Value = "hello"
and:
Range("Sheet1!M5").Value = "hello"


No luck, I only get "#VALUE!" in the cell where the VBA script is running
from, and no "hello" in cell M5.


Regards,
Lars-Inge