Don't select what I selected, select what YOU think you should select!
January 2, 2012 4:51 PM Subscribe
Help me understand how to make a macro do what I want it to do - automatically select the relevant area instead of a previously recorded cell range.
posted by komara to Computers & Internet (6 answers total) 2 users marked this as a favorite
I run lots of reports every month that get dumped into Excel and I try to use macros for as much as I can - but I can't figure this one out. If have only one cell selected and click 'data sort' or 'create pivot table' then the selection is expanded to all the cells that have information in them. This is 99% of the time exactly what I want, so that's what I do.
If I record this action as a macro, though, and then run it again later on a spreadsheet with fewer or more rows than the original then it only selects exactly the size of the data that was present when recording the macro. I know just enough to go in and look at the lines of the macro and see where it says things like "select A2:G411".
How do I change that to say "do the magic you do when I just ask you to select what you think is relevant"?