excel-courses - macro

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

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

excel-courses - Macro

resolvedResolved · Low Priority · Version 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.


 

Excel tip:

Line breaks in a cell

You can control the line breaks for multiple-line headings or labels in your Microsoft Excel worksheet, just like you do in Microsoft Word. Here's how to do it.

Click the cell where you want the label or heading to appear.
Type the first line of information.
Press ALT+ENTER.

View all Excel hints and tips


Server loaded in 0.08 secs.