Thread: [Solved] recording ranges in macros
View Single Post
 
Old 09-04-2017, 06:53 AM
jeffreybrown jeffreybrown is offline Windows Vista Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Here is an example. Let's say we are going to copy and paste A1:A10 to H11.

The recorded marco would look like...

Code:
Sub Macro2()
    Range("A1:A10").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("H12").Select
    ActiveSheet.Paste
End Sub
But what if the range was not always A1:A10. Could be shorter, could be longer.

Code:
Sub Macro2()
    Selection.Copy Destination:=Range("H11")
End Sub
Reply With Quote