I am new to macros and am having trouble creating a macro that will copy a range of cells and then paste just the values back into the same cells. Basically I just need to get rid of the formulas and paste the value back into the same location.
I have tried the coding below, but I am getting an error that says "Run-time error '1004': PasteSpecial method of Range class failed." Can anyone help?
Sub CopyPaste()
Worksheets("Sheet1").Range("A1:G105").Copy
Worksheets("Sheet1").Range("A1:G105").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub
I have tried the coding below, but I am getting an error that says "Run-time error '1004': PasteSpecial method of Range class failed." Can anyone help?
Sub CopyPaste()
Worksheets("Sheet1").Range("A1:G105").Copy
Worksheets("Sheet1").Range("A1:G105").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub