ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cells(1) (https://www.excelbanter.com/excel-programming/454198-cells-1-a.html)

[email protected]

Cells(1)
 
What feature of Excel VBA am I using when I address cell "A1" as Cells(1)?

GS[_6_]

Cells(1)
 
What feature of Excel VBA am I using when I address cell "A1" as Cells(1)?

Its INDEX!
Cells(1) assumes the 1st cell in column 1 when no argument is specified.
Cells(1) = Cells(1,1)

In a range...
Range("A1:D8").Cells(1) refs A1
Range("A1:D8").Cells(32) refs D8
Range("A1:D8").Cells(16) refs D4
Range("A1:D8").Cells(8) refs D2

...where count is left-to-right, top-to-bottom

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

[email protected]

Cells(1)
 
On Wednesday, December 12, 2018 at 5:24:26 PM UTC+11, GS wrote:
What feature of Excel VBA am I using when I address cell "A1" as Cells(1)?


Its INDEX!
Cells(1) assumes the 1st cell in column 1 when no argument is specified.
Cells(1) = Cells(1,1)

In a range...
Range("A1:D8").Cells(1) refs A1
Range("A1:D8").Cells(32) refs D8
Range("A1:D8").Cells(16) refs D4
Range("A1:D8").Cells(8) refs D2

..where count is left-to-right, top-to-bottom

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Thank you!!


All times are GMT +1. The time now is 08:14 AM.

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