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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
It shouldn't give you 2

End property will give you the last cell which is not blank.
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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