2

I'm trying to rewrite someone's program, but I'm not familiar with VBA. I've tried many different ranges with .End(x1Up) and (x1Down). I understand the Up is the better option, but it just keeps pasting it in the same row every time and doesn't drop down to the next one. Here's my code (many tries have been commented out):

Sub Save_History()

Sheets("Simple Calculation").Select

Range("A10:J10").Select

Selection.Copy

    'Sheets("Media Data History").Select

    'Range("A65536").End(xlup).Offset(1,0)
    'If Range("A1") <> "" Then
    'Range("A1").End(xlUp).Offset(1, 0).Select
    'End If
    '   Range("A1").End(xlUp).Select

    'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub
pnuts
  • 58,317
  • 11
  • 87
  • 139
Amy Snyder
  • 23
  • 1
  • 4

2 Answers2

0

This should work but I encourage you to take a look at THIS Post

Sub Save_History()

    Sheets("Simple Calculation").Select

    Range("A10:J10").Select

    Selection.Copy

    Sheets("Media Data History").Select

    Range("A65536").End(xlup).Offset(1,0).Select

    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False

End Sub
Community
  • 1
  • 1
simpLE MAn
  • 1,582
  • 13
  • 22
0

Got it!!

Sub Save_History()

Sheets("Simple Calculation").Select

Range("A10:J10").Select

Selection.Copy

    Sheets("Media Data History").Select

              Range("A" & Rows.Count).End(xlUp).Offset(1).Select

    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub
Amy Snyder
  • 23
  • 1
  • 4