I am trying to create a simple sheet to copy various ranges of data and move them up one row inside a chart when somebody click on a command button. There are two cells that a command button may pull data from to create a result. I intend for the button to highlight a row at some point but right now I just want it to copy and paste a range of cells up one row then clear out the data left in the bottom row of a chart. I have not coded the clearing of the last row yet because I cannot seem to get paste the "Compile Error: Sub or Function not defined". I have searched and tried multiple different recommendations for doing what I need and am at the point where my brain can't think straight anymore.
Code:
Private Sub Submit_Click()
If IsEmpty(Worksheets("Sheet1").Range("h37")) = True And IsEmpty(Worksheets("Sheet1").Range("h35")) = True Then
'Verifies that a selection was made
MsgBox "No selection made or date entered."
Exit Sub
ElseIf IsEmpty(Worksheets("Sheet1").Range("h37")) = False And IsEmpty(Worksheets("Sheet1").Range("h35")) = False Then
'Verifies that both inputs weren't modified
MsgBox "Select an existing End Of Period or enter date to create a new one."
Exit Sub
ElseIf IsEmpty(Worksheets("Sheet1").Range("h37")) = False And IsEmpty(Worksheets("Sheet1").Range("h35")) = True And _
Not Worksheets("Sheet1").Range("h37").Value = Worksheets("Sheet1").Range("a30").Value Then
'Range Copy and Paste
Worksheets("Sheet1").Range("A5:c30").Copy = Worksheets("Sheet1").Range("a4:c29")
Worksheets("Sheet1").Range("e5:f30").Copy = Worksheets("Sheet1").Range("e4:f29")
Worksheets("Sheet1").Range("h5:i30").Copy = Worksheets("Sheet1").Range("h4:i29")
Worksheets("Sheet1").Range("k5:l30").Copy = Worksheets("Sheet1").Range("k4:l29")
Worksheets("Sheet1").Range("n5:o30").Copy = Worksheets("Sheet1").Range("n4:o29")
Worksheets("Sheet1").Range("q5:r30").Copy = Worksheets("Sheet1").Range("q4:r29")
Worksheets("Sheet1").Range("t5:u30").Copy = Worksheets("Sheet1").Range("t4:u29")
Worksheets("Sheet1").Range("w5:x30").Copy = Worksheets("Sheet1").Range("w4:x29")
Worksheets("Sheet1").Range("h37").Copy = Worksheets("Sheet1").Range("a30").PasteSpecial(xlPasteValues)
Worksheets("Sheet1").Range("h37").ClearContents
End If
End Sub