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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paste function error

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Help please

The following code has an error in the paste function can anyone fix it cheers.

Sub FindSub()

msheet = ActiveSheet.Name
Select Case msheet
Case "BoQ"
Range("s:s").Select
Selection.Find(What:="01", After:=ActiveCell, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -11).Select
End Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

End Sub
 
guesser,

I see two problems:

The Find method of the Range object does not take the SearchFormat named argument. The only other named argument allowed, beyond the ones you have indicated, is MatchByte, which is strictly for the Far East version of Excel.

There is no Copy method invoked by your code. Therefore, the PasteSpecial method will fail.

HTH
M. Smith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top