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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
It shouldn't give you 2

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

Forum statistics

Threads
1,217,757
Messages
6,138,430
Members
450,137
Latest member
HANHAN

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