ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   refer to cells by number (https://www.excelbanter.com/excel-programming/378867-refer-cells-number.html)

n3llyb0y

refer to cells by number
 
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


Mike Fogleman

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





All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com