Last row capture issue

yuvastanza

New Member
Joined
Mar 1, 2011
Messages
19
Hello Geeks,

I need a help on the issue i am facing in excel, the excel sheet which i am using has a problem like if i give a control + down arrow from the beginning of the table which has data, it should stop at the last line of the table. However it is not stopping and crossed the table and stop at the apart several blank cells. i checked if the blank cells has data or formulas but nothing found in it. What i want is how to resolve the sheet to stop as per the excel methodology. It is disturbing my VBA code and leads to malfunctioning.

The following VBA code which i used to the action:

[code/]ActiveSheet.Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 7).Select
ActiveSheet.Range(Selection, Selection.End(xlUp)).Select
Selection.FillDown
ActiveSheet.Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 7).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Range(ActiveCell, ActiveCell.Offset(50, 0)).Select
Selection.ClearContents
[/code]
The purpose of the above code is, once the table of contents pasted in the Excel sheet, the Cursor goes to Cell A1 and comes down to the last row of the Table then it will move to the 7th column from the active cell, then filldown the formula setup in the seventh column. then it will take one step down and remove the if the formula was already existed in the blank cells.
 
Last edited:

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,215,375
Messages
6,124,578
Members
449,174
Latest member
chandan4057

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