I have a recorded macro that basically takes a selected row, cut's it, then moves it to a different sheet and inserts it at line 2, then re-formats the data to just the values and then returns to the original sheet and deletes the now empty line.
I have recorded this macro several times but when I attempt to use it after attaching to an active x button it breaks!
I get a Run Time Error '1004'
Select method of Range class failed
When I click on Debug it highlight the line of code showing where I select line 2 on the new sheet to insert the cut data.
Here is my code completely un-adulterated from the "recorded" version:
<code>
Private Sub RFQHistory_Click()
'
' RFQHistory - Moves data to RFQ History Tab and freezes time on that tab for a final snapshot, also removes the line from SLA CLOCK completely
'
Selection.Cut
Sheets("RFQ History").Select
Rows("2:2").Select
Selection.Insert Shift:=xlDown
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("SLA CLOCK").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
End Sub
</code>
How can this be what the wizard "records" yet not work? The only thing I did, was moved it from the Module to the Sheet1 Object.
Any help would be greatly appreciated
I have recorded this macro several times but when I attempt to use it after attaching to an active x button it breaks!
I get a Run Time Error '1004'
Select method of Range class failed
When I click on Debug it highlight the line of code showing where I select line 2 on the new sheet to insert the cut data.
Here is my code completely un-adulterated from the "recorded" version:
<code>
Private Sub RFQHistory_Click()
'
' RFQHistory - Moves data to RFQ History Tab and freezes time on that tab for a final snapshot, also removes the line from SLA CLOCK completely
'
Selection.Cut
Sheets("RFQ History").Select
Rows("2:2").Select
Selection.Insert Shift:=xlDown
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("SLA CLOCK").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
End Sub
</code>
How can this be what the wizard "records" yet not work? The only thing I did, was moved it from the Module to the Sheet1 Object.
Any help would be greatly appreciated