cells.End(xltoright) Not working

abeed

Board Regular
Joined
Nov 19, 2005
Messages
79
Hi: My data (in a excel sheet) are like this.

v37426 1.17135907 1.19648498 1.17981816----row number 2 here

My firt cell is cells(2,1) with data v37426
2nd cell is cells(2,2) with data 1.17135907

I was trying to use:
dim cn as integer
cn = cells(2,1).end(xltoright).column which is supposed to give me cn =2
But its giving me cn =192(which is the last data cell in this row.

if I am wrong what should I do to get column number of the next available cell(with data) from my active cell(say cells(2,1) is active) . The result in this case will be 2.
Thanks
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
It shouldn't give you 2

End property will give you the last cell which is not blank.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,553
Messages
5,838,075
Members
430,527
Latest member
MyFace2

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
Top