# To what extent should a recorded Excel macro be rewritten (removing .Select)?

I'm just feeling my way around here, having had a post recently moved over from another site together with its question. While I like the idea of a place to ask specifically for improvements to working code, I also see the potential for a lazy coder to 'code dump' something like a rat's nest of recorded MS Office VBA in the hopes of getting someone to clean it up.

What are the expectations of an answer to a situation like that? Are rewrites to one or two blocked sections that address different methods sufficient to meet site standards of a quality answer or should larger or even complete rewrites be provided?

My viewpoint is generally to help the user(s) help themselves, not do their work for them. If I rewrite something like this:

    Sheets("Sheet1").Select
Range("A1").Select
Selection.Copy
Sheets("Sheet2").Select
Range("B8").Select
ActiveWindow.SmallScroll Down:=-45
ActiveWindow.LargeScroll ToRight:=-1
Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("A2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
(etc., etc., etc. ...)


To something like,

    With Sheets("Sheet1")
.Range("A1").Copy Destination:=Sheets("Sheet2").Range("A1")
(you can follow this method for all of the others)
End With


Is this a satisfactory rewrite that meets site standards? Granted, if the recorded code also included something like a .Sort operation then that should be addressed as well if an improvement could be offered.

Hmmm... might need a tag specifically for Site Standards; especially during the weaning period.

• Your question is not quite clear to me, but short answers are acceptable! No answer can claim completeness anyways... There is no actual need to use code-blocks in an answer, since explanations and clear references are often sufficient. – Vogel612 Feb 25 '15 at 14:53
• On a personal note, welcome to Code Review! Feel free to drop by Code Review Chat or the CR VBA chatroom. – RubberDuck Feb 25 '15 at 14:57
• @Vogel612 - I'll edit my answer for clarity when I work out some verbiage. In short, I was wondering about site standards when dealing with recorded macro 'code dumps' which can get very repetitious and to what extent an answer should address the code as a whole. Are isolated pockets dealing with methods sufficient or should the code dump be treated as a whole? – user66882 Feb 25 '15 at 14:58