Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PasteSpecial Not Working but no Error 1

Status
Not open for further replies.

tcgoth

IS-IT--Management
Aug 17, 2005
54
US
I have the following code. Everything works fine, Except for the PasteSpecial. I end up with a new file with only one sheet named "Results" - but the formulas are still present - obviously I just want the Values. I've tested the PasteSpecial code by itself and it works fine. No errors are generated. Any ideas what is going on here???

Code:
Private Sub CommandButton1_Click()

    ActiveWorkbook.SaveAs "C:\Documents and Settings\Terry\" & ActiveSheet.Cells(9, 2) & ".XLS"
Sheets("Results").Select
Dim R As Range
Set R = Range("A1:C37")
    R.Copy
    R.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
    Sheets("Input Sheet").Select
    Application.DisplayAlerts = False
    ActiveWindow.SelectedSheets.Delete
    Sheets("Sheet2").Select
    ActiveWindow.SelectedSheets.Delete
    Sheets("Sheet3").Select
    ActiveWindow.SelectedSheets.Delete
    ActiveWorkbook.Save
    

End Sub
 
Why not simply this ?
Sheets("Results").Range("A1:C37").Value = Sheets("Results").Range("A1:C37").Value

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Straightforward response and you nailed it PH! Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top