View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default refer to cells by number

Columns(1).Cells.Value2 = 1
Fills column A

Rows(2).Cells.Value2 = 1
Fills row 2

Cells.Value2 = 2
Fills entire sheet

Mike F
"n3llyb0y" wrote in message
news:2006120618092116807-n3llyb0y@aolcom...
Hi,

I'm a newbie to excel automation and could do with some guidance. I'm
trying to set cell values using variables within office 2007 but the only
method I can find to set values is via "Range" - and I can only appear to
specify Range values if a column header is specified: eq. A2.

I don't seem to be able to reference "Cells", "Row" or "Column" directly

For example, I am currently having to use:
ExcelWorksheetobject.range("A1").value2 = "my value"

Any guidance would be appreciated.

Thanks
Neil