Correct usage of Cells()

fredrerik84

Active Member
Joined
Feb 26, 2017
Messages
383
Hi I hope some of you that are more experienced then me can help me with the correct usage of cells()

In my code I have it like this

Cells(z, "AM")

Where Z is an counter , this works perfect , but if I want the counter on the column instead , what do I need to do

I have this solution, Cells(21, z) which works but would be better that I could use column letter instead of 70 as its hard to tell (for me where column number 70 is.

I have tried this: Cells("M", z) but this gives an error :/
 
Last edited:
Immediate window is, well, for immediate results. :)
Press Ctrl+G in VBA Editor and just type in: ?Cells(1, 55).Address(0, 0)
Then press Enter.
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,215,274
Messages
6,123,993
Members
449,137
Latest member
abdahsankhan

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