VBA How to copy the content of a cell without .Select

George picture George · May 22, 2013 · Viewed 73.5k times · Source

I am writing a method that can take the Target and paste the cell exactly to another cell. The cell is a shipping label with some fancy formatting. Is there a way I can do it?

Originally I have this:

Worksheets("Label").Range("A1").Value = Worksheets("Get Address").Range("A28").Value

It worked for the plain text. However I lost the styling I created, they are different because after the first line, the style is different:

enter image description here

I also tried to use Macro Recorder and I got a solution using .Select, and I read this question not to use it whenever possible. What can I do?

' Created by the Macro Recorder
Range("A28:A33").Select
Range("A33").Activate
Selection.Copy
Sheets("Label").Select
Range("A1").Select
ActiveSheet.Paste

Answer

Tim Williams picture Tim Williams · May 22, 2013
Worksheets("Get Address").Range("A33").Copy _
       Destination := Worksheets("Label").Range("A1")