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

  • Home
  • SEARCH
  • 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 9129551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:46:32+00:00 2026-06-17T07:46:32+00:00

I want to copy all rows and columns from various sheets and paste in

  • 0

I want to copy all rows and columns from various sheets and paste in an one worksheet one below the other .

But I am getting error . I tried using various example provided by the site . But none is working for me . Could please help me in resolving . I passing the worksheets in array .So I will get sheets in order.

I provided code where I am getting error . I am getting error in the pasting section . It is sayings that it should be either A1 or R1C1 . But I need to paste all sheets one below the another in one sheet.

For m = 1 To fnum


lastrow = tempws.Range("A" & ws.Rows.Count).End(xlUp).Row

ws(m).Cells.Copy tempws.Cells((lastrow + 1), 1)

Next m

tempws.Save
  • 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-17T07:46:34+00:00Added an answer on June 17, 2026 at 7:46 am

    It’s because you are trying to copy the ENTIRE range of cells of a worksheet into a section that is less than an entire sheet, on the main sheet. It won’t work, because there aren’t enough cells left. You need to size down your copy sheet to only capture the cells with data.

    Something like this should be a good framework to get you started. You may need to tweak things to fit your data. Also, this assumes that all the data in your copy sheets starts from cell A1. Again, adjust if needed.

    For me = 1 to fnum
    
        lastrow = tempws.Range("A" & tempws.Rows.Count).End(xlUp).Row 'i changed this to tempws, as you just had ws
    
        With ws(m)
    
            lastcopyrow = .Range("A" & .Rows.Count).End(xlup).Row
            lastcopycol = .Range("A" & .Columns.Count).End(xlToLeft).Column    
    
            .Range("A1",.cells(lastcopyrow, lastcopycol)).Copy tempws.Cells((lastrow + 1), 1)
    
        End With
    
    Next m
    

    Also, if you are getting a reference error due to A1 or R1C1 notation, you may want to just paste as values, instead of a straight copy / paste.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to copy all the rows and columns from one table to another.
I have data in multiple columns from rows 3-15. I want to find all
I want to copy all rows from table and insert this rows in itself
I want to copy all the rows from my table with single column update.
I want to copy a xml file from one remote box to a bunch
I want to copy all the fields from the temp_sales table to sales table
I want to copy a record with all his relations. I'm trying with: $o
i want copy pdf file from application path(/data/data/package name) to sdcard.for that i have
I want to copy a selection of lines from a file to another file
I want to copy directories and their subdirectories from C: to D: with same

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.