tags:

views:

106

answers:

2

Pressing Ctrl+End in Excel takes you to the bottom-right-most cell of the worksheet.

If you delete the last rows or columns and save the workbook, this last cell gets updated (and the scroll bars do to).

I remember there was a one line vba command that you could run that would do the update without having to save the workbook, but I can't remember what the command is, do you have any ideas?

Thanks.

+1  A: 

What about this one? http://www.excelexperts.com/VBA-Tips-Reset-the-Used-Range

Cyril
A: 

Thanks Cyril, that's exactly what I was looking for.

Here is the answer:

Sub x()
    ActiveSheet.UsedRange
End Sub

Run this and the last cell will be reset.

Laurent