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 8092431
In Process

The Archive Base Latest Questions

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

This is a bit of a trivial error but I cannot figure it out.

  • 0

This is a bit of a trivial error but I cannot figure it out. I have a vba script that is copying and pasting a couple of items. It works on all but the last. The error is

The information cannot be pasted because the Copy area and the paste
area are not the same size and shape. Try one of the following:

  1. Click a single cell, and then paste. •
  2. Select a rectangle that’s the same size and shape, and then paste.

Here is the code:

Sub MakePropertyPage(propertyNum, aFile)
Dim sheetName As String
sheetName = "Prop " & propertyNum

'OPENS INDIVIDUAL WORKBOOKS TO PULL IN INPUT INFORMATION
Workbooks.Open Filename:=vpath & ThisWorkbook.Path & "\" & aFile & ".xlsb",                 UpdateLinks:=False, ReadOnly:=True

Dim sourceRangeAsString As String, dest As Range, clearArea As Range
Dim sheetToEdit As Worksheet
Set sheetToEdit = ThisWorkbook.Sheets(sheetName)

Set clearArea = sheetToEdit.Range("AL100:CC900")
clearArea.Delete

sourceRangeAsString = "RentRoll"
Set dest = sheetToEdit.Range("AL100")
Call CopyAndPaste(Workbooks(aFile & ".xlsb"), sourceRangeAsString, dest)

sourceRangeAsString = "Underwriting"
Set dest = sheetToEdit.Range("AL300")
Call CopyAndPaste(Workbooks(aFile & ".xlsb"), sourceRangeAsString, dest)

sourceRangeAsString = "Projections"
Set dest = sheetToEdit.Range("AL400")
Call CopyAndPaste(Workbooks(aFile & ".xlsb"), sourceRangeAsString, dest)

sourceRangeAsString = "RolloverCalculations"
dest = sheetToEdit.Range("AL500")
Call CopyAndPaste(Workbooks(aFile & ".xlsb"), sourceRangeAsString, dest)



'Close the workbook now that we are done with it
Workbooks(aFile & ".xlsb").Close savechanges:=False
End Sub

Sub CopyAndPaste(sourceFile, sourceRangeAsString, dest)
    Set source = sourceFile.Names(sourceRangeAsString).RefersToRange
    source.Copy
    dest.PasteSpecial (xlPasteValues)
    source.Copy
    dest.PasteSpecial (xlPasteFormats)
End Sub
  • 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-05T20:16:56+00:00Added an answer on June 5, 2026 at 8:16 pm

    You’re missing a Set here:

    dest = sheetToEdit.Range("AL500")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I feel this question may be a bit trivial, but I simply cannot wrap
This might seem like a trivial question, but I'm a bit muddled in my
I'm sorry, my SQL is a bit rusty so this might be trivial, but
I'm relatively(read: stupid newbie) familiar with disassembly but this bit stumped me: I have
I know this might sound that it should be trivial but I am finding
This might be trivial for some of you, but I have two screenshots from
I know this is a bit trivial but I just picked up jQuery tonight
I have a feeling this is a rather trivial question, but I'm stumped. In
This bit of code comes with new classes that are subclasses of UITableViewController... -
So I have this bit of code for x in range(x1,x2): for y in

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.