0

This seems like it is very easy, but I have not written VBA in a few years. The file I'm working with has set formats when I receive it. I have to UnMerge columns (which works okay). Then I need to Select range to be copied, Select copy range and then move the range up one line so I can paste data. Can someone help with this last part? I can't seem to get the move up, to select the correct range to select.

The paste is okay.

Sub unMerge()

    Range("A9:B5000").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.unMerge

End Sub

Sub CopyRange()

Dim R As Range

    Range("A10").Select
    Selection.copy
    Range(Selection, Selection.End(xlDown)).Select
    ActiveCells = "R"
    ActiveCells = "R" - 1 'This is the line I really need help with.
    ActiveSheet.Paste
    Selection.End(xlDown).Select
Scott Craner
  • 148,073
  • 10
  • 49
  • 81
Chuck B
  • 1
  • 1
  • I highly recommend [avoiding using `.Activate`/`.Select`](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba-macros). Instead, put the range into a variable, or work directly with the data. – BruceWayne Aug 29 '16 at 20:31
  • Mainly focus on `ActiveCell`, this is the active cell. To keep your code as-is, but with the row-1, I believe you can do `ActiveCells.Offset(-1,0) = "R"` – BruceWayne Aug 29 '16 at 20:50

0 Answers0