Cells: Referencing by Row and Column and Cell Position

abktw2

New Member
Joined
Jul 17, 2008
Messages
15
Hello-

I was hoping someone could explain to me the Cells property. I am teaching vba programing from a book to design a ss to work how we need it, but I am having trouble understanding this property. Specifically when using Cells(Rowindex, Columnindex) and Cells(CellPosition) and how it applies to Range.Rows.Count Any help on how to use these properties and why I would want to do so would be great. Thanks.

Adam
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Cells(RowIndex,ColumnIndex) is another way to select a certain cell.

For example....

Cells(1,1) means Range("A1")

Cells(1,3) means Range("C1")

Cells(23,5) means Range("E25")

You can use the same arguments with cells as you can range... for example if you want to find the last row in a column with cells versus range...

Cells(rows.count,1).End(xlUp).Row

A big advantage to the Cells property is now you can find the last column in a given row!

Cells(1,columns.count).End(xlLeft).Column
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top