The macro recorder is the built in excel function to make a macro of stuff you do...
you start the macro recorder, do what you want the macro to do, then end it
then you can see (and adjust) the macro it made.
For example, if I use the macro recorder to select a few cells in sheet2 and put them in sheet1, the recorded macro looks like this :
Sub Macro1()
'
' Macro1 Macro
'
'
Sheets("Blad2").Select
Range("E4:E10").Select
Selection.Copy
Sheets("Blad1").Select
Range("C10").Select
ActiveSheet.Paste
Range("C19").Select
End Sub
then you can slim that down to 'proper' code with overhead stuff removed, like this :
Sub Macro1()
Sheets(2).Range("E4:E10").Copy Destination:=Sheets(1).Range("C10")
End Sub
Does the same, simpler code :-)
Bookmarks