Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8042225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:30:16+00:00 2026-06-05T04:30:16+00:00

Following is my code that’s throwing this error: PasteSpecial method of Range class failed

  • 0

Following is my code that’s throwing this error:

PasteSpecial method of Range class failed

Error is throwing only when I’m trying to debug.

Range(Cells(7, 1), Cells((Rowrange + 7), 2)).Select
Selection.PasteSpecial Paste:=xlValues


  ' my complete code

strSheetName = "sheet1"
Sheets(strSheetName).Select
B6 = Range("B6").Value
B7 = Range("B7").Value
Range(Cells(11, 1), Cells((Rowrange + 11), 2)).Select
Selection.Copy

strSheetName = "sheet2"
Sheets(strSheetName).Select
' Range(Cells(7, 1), Cells((Rowrange + 7), 2)).Select
'.Range(Cells(7,1), .Cells(RowRange + 7, 2). PasteSpecial Paste := xlValues
'Selection.PasteSpecial Paste:=xlValues
With ActiveSheet
.Range(.Cells(7, 1), .Cells(Rowrange + 7, 2)).PasteSpecial Paste:=xlValues
End With

Is there a way to avoid this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:30:18+00:00Added an answer on June 5, 2026 at 4:30 am

    I believe (If the above is actually your complete code) you are not copying the data and directly trying to do a paste and hence you are getting that error 🙂

    Is this what you are trying?

    strSheetName = "Estimated vs Actual Costs"
    With Sheets(strSheetName)
        .Range(.Cells(7, 1), .Cells(RowRange + 7, 2)).Copy
        .Range(.Cells(7, 1), .Cells(RowRange + 7, 2)).PasteSpecial Paste:=xlValues
    End With
    

    FOLLOWUP

    Try this

    strSheetName = "sheet1"
    With Sheets(strSheetName)
        B6 = .Range("B6").Value
        B7 = .Range("B7").Value
        .Range(.Cells(11, 1), .Cells((RowRange + 11), 2)).Copy
    End With
    
    strSheetName = "sheet2"
    With Sheets(strSheetName)
        .Range(.Cells(7, 1), .Cells(RowRange + 7, 2)).PasteSpecial Paste:=xlValues
    End With
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that is throwing this error but the solutions I've
I have the following code that is trying to catch the exception caused by
Hi all I have following code that generates error why.If any know please suggest
I have the following code that should add an active css class to the
I've got the following code that I am trying to use to access a
I have the following code that creates a serverside object of the xmlhttp class.
I have the following code that captures my 'Team_ID' Get parameters and I'm trying
I have the following code that resides in my .js file //This is the
I am using the following code that I originally found from this question: Prevent
I have the following code that sets a cookie: string locale = ((DropDownList)this.LoginUser.FindControl(locale)).SelectedValue; HttpCookie

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.