VBA: Named Argument Not Found error

gers1978

Board Regular
Joined
Sep 9, 2014
Messages
74
Ok, this code works fine:

Code:
detailsSheet.Cells.Copy
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues

But conscious that using Selection can be slower, I tried:

Code:
detailsSheet.Cells.Copy
detailsSheet.PasteSpecial Paste:=xlPasteValues

This gives me a compile error, "named argument not found".

(details.Sheet is set elsewhere, on a user form, as a worksheet)

Also posted here:

http://www.ozgrid.com/forum/showthread.php?t=200128&p=772398#post772398
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
detailsSheet.Cells.Copy
detailsSheet.Cells.PasteSpecial Paste:=xlPasteValues
 
Upvote 0
Hmm, seem to have solved it with:

Code:
detailsSheet.Range("A1").PasteSpecial Paste:=xlPasteValues

Could someone explain why this works but:

Code:
detailsSheet.PasteSpecial Paste:=xlPasteValues

doesn't? Thanks
 
Upvote 0
Greetings:

Look at help topics for Range.PasteSpecial Method and Worksheet.PasteSpecial Method. You will see that there is no 'Paste:=' parameter for the worksheet method.

Hope that helps,

Mark
 
Upvote 0
Try this:
Code:
Sub Remove_Formulas()

With Sheets("detailsSheet").UsedRange
        .Value = .Value
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,824
Members
449,190
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top