ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cells(col,row) keep moving to lower case and I can not ref. a cells in a differnet sheet (https://www.excelbanter.com/excel-programming/328154-cells-col-row-keep-moving-lower-case-i-can-not-ref-cells-differnet-sheet.html)

WayneL[_2_]

Cells(col,row) keep moving to lower case and I can not ref. a cells in a differnet sheet
 
Hi


I a writing VBA in Excel and I can not get the following line to run:

Sheets("Sheet1").cells(Row, Col).Value = Num


The "cells" part turns from "Cells" to "cells" when I hit return and I guess
it treats it like an array not a cell location.

Can anyone help clear this up.

Cheers

Wayne



Vasant Nanavati

Cells(col,row) keep moving to lower case and I can not ref. a cells in a differnet sheet
 
Do you have "cells" defined somewhere else? This generally happens when you
(mis)use a reserved word elsewhere in the project.

--

Vasant

"WayneL" wrote in message
...
Hi


I a writing VBA in Excel and I can not get the following line to run:

Sheets("Sheet1").cells(Row, Col).Value = Num


The "cells" part turns from "Cells" to "cells" when I hit return and I

guess
it treats it like an array not a cell location.

Can anyone help clear this up.

Cheers

Wayne





Don Guillett[_4_]

Cells(col,row) keep moving to lower case and I can not ref. a cells in a differnet sheet
 
I just tested this on xl2002

Sub ddd()
num = 12345 '"dd"
Row = 1
col = 5
Sheets("Sheet1").Cells(Row, col).Value = num
End Sub

--
Don Guillett
SalesAid Software

"WayneL" wrote in message
...
Hi


I a writing VBA in Excel and I can not get the following line to run:

Sheets("Sheet1").cells(Row, Col).Value = Num


The "cells" part turns from "Cells" to "cells" when I hit return and I

guess
it treats it like an array not a cell location.

Can anyone help clear this up.

Cheers

Wayne






All times are GMT +1. The time now is 10:17 AM.

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