0

This code was created using the Macro recorder, so I feel that it is probably not the most efficient way to do this.

Sub Print_Completed()

Application.ScreenUpdating = False

    Sheets("Saver").Select
    ActiveSheet.Shapes.Range(Array("Graphic 1")).Select
    Selection.Copy
    Sheets("Main").Select
    ActiveSheet.Paste
    
Application.ScreenUpdating = True

End Sub

This copies a shape from one sheet and pastes it into the active cell of another. I was wondering if it was possible to paste this shape into the active cell without deselecting the cell the shape is being pasted into.

I'm sure it sounds silly, but this would save a considerable amount of clicking, and in the spirit of making things as efficient as possible it was a curiosity of mine.

I tried to look up several different methods for selection and pasting in Excel through VBA, but I could not find anything that could paste the shape without selecting it as well.

Ken White
  • 123,280
  • 14
  • 225
  • 444
fatmstr97
  • 11
  • 2

1 Answers1

1

Its better to refer to the objects directly and not select or activate them.

Sub Print_Completed()
    Dim Graphic1 As Shape
    Set Graphic1 = Worksheets("Saver").Shapes("Graphic 1")
    Graphic1.Copy
    Worksheets("Main").Range("A1").PasteSpecial
End Sub
TinMan
  • 6,624
  • 2
  • 10
  • 20