98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » excel-courses - Macro
excel-courses - Macro
Resolved · 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.'
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 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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Line breaks in a cellYou 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. |