Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

excel-courses - macro

Forum home » Delegate support and help forum » Microsoft Excel Training and help » excel-courses - Macro

excel-courses - Macro

ResolvedVersion Standard

Diana has attended:
No courses

Macro

If I need to go to the last filled in cell on a worksheet and then I add in further rows how do I set the range to make sure it goes to the 'new end' rather than to the 'original end.'

Edited on Wed 16 Jan 2008, 13:39

Reset the range in a macro macro

Hi Diana

If you have already defined the range in a macro this needs to be edited so that the computer picks up the new range every time. To do this:

Lets say the range in the macro is

Range (A9:Z250).Select

Now since in the example the data always starts at "A9" and you don't know if you are adding more rows or columns then you need to edit your range in the macro as follows:

Range("A9", Range("A9").End(xlToRight).End(xlDown)).Select

This takes cell "A9" as the starting point and highlights all the adjacent columns and rows in the range that contain data.

Hope this helps

Carlos

 

Training courses

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.11 secs.