IF activecell is....

fahimip

New Member
Joined
Sep 27, 2006
Messages
35
Ive come to the end of writing a code that involves scrolling down to the next empty cell using;
Selection.End(xlDown).Select
What i need is some form of code that will end the sub once the active cell becomes the last cell in the sheet.
Im not sure how to do this using If functions.

Any other ideas will be welcome

any help will be greatly appreciated
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Hi

Welcome to the Board!

Using an If statement you could use:

Code:
If Activecell.row = Application.Rows.Count then Exit Sub

Best regards

Richard
 

fahimip

New Member
Joined
Sep 27, 2006
Messages
35
Richard your a star,

thats exactly what i needed.


Thank for your help
 

Forum statistics

Threads
1,137,341
Messages
5,680,926
Members
419,945
Latest member
Carrie Sellers

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