View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Thomas Thomas is offline
external usenet poster
 
Posts: 107
Default Unable to write to a cell

David,

try this:

Range("B5").Value = "Try this"

If you want to operate with variables (rowRange etc.) you have to define
them first (Dim rowRange as LOng)


"David A." wrote:

I am having surprising difficulting wriiting to a cell within a worksheet. I
have tried various approaches and have receive the same erro on all attempts;
Code below

Set rawRange = Range("B5")
rawRange.Value = "data"

Or

ActiveWorkbook.Worksheets("test1").Cells(2, 2).Value = "Please work"

in the first example I can read the data out via the immediate window, but
can't write out..
I get this error "Application-defined or object-defined error" Please help!!!