0

I am trying to write macro that selects a range of cells relative to my active cell and copies all the cells that are selected.

Currently the code I have selects these cells but doesn't copy them.

Sub CellCopy()
ActiveCell.Offset(0).Resize(5, 8).Select
ActiveCell.Copy
End Sub

Thanks, sorry for the very begginer post.

Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
  • 3
    `ActiveCell.Offset(0).Resize(5, 8).Copy` but you have to Paste somewhere. – SJR Jun 06 '19 at 20:34
  • When you step through your code via `F8` function key, does your spreadsheet show the "marching ants" moving dashed lines? – Mark Stewart Jun 06 '19 at 22:46
  • Not sure if it is do-able for this case but I recommend reading on: [How to avoid using Select in Excel VBA](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba) – erazorv4 Jun 07 '19 at 07:02

1 Answers1

2

Instead of

    Activecell.Copy

You need to use

   Selection.Copy