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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

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