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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:58:25+00:00 2026-06-11T15:58:25+00:00

Is it possible to copy data from all the workbook sheets from one excel

  • 0

Is it possible to copy data from all the workbook sheets from one excel sheet (ex: A.xls) to another existing excel (ex: B.xls).

Can a logic be implemented, using VB, where it can do that no matter the amount of workbook sheets in A.xls (i.e. It should copy all the data of all pages of A.xls to B.xls)

I appreciate any kind of help, for I am not from a programming background.

  • 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-11T15:58:26+00:00Added an answer on June 11, 2026 at 3:58 pm

    Well After a lot of struggle and learning some basics i was able to get the code

    Here is the code which works

    Set objExcel = CreateObject("Excel.Application") 
    objExcel.Visible = True
    Set objPasteData = objExcel.Workbooks.Open("C:\A.xlsx") 'Copy From File
    Set objRawData= objExcel.Workbooks.Open("C:\B.xls")             'Paste To File
    Set obj1 = objPasteData.WorkSheets("RawData") 'Worksheet to be cleared
    obj1.Cells.Clear
    countSheet = objRawData.Sheets.Count
    
    
    For i = 1 to countSheet
        objRawData.Activate
        name = objRawData.Sheets(i).Name
    
        objRawData.WorkSheets(name).Select
        objRawData.Worksheets(name).Range("A2").Select
    
        objExcel.ActiveSheet.UsedRange.Select
        usedRowCount1 = objExcel.Selection.Rows.Count
    
        objExcel.Range("A2:H" & usedRowCount1).Copy
        objPasteData.Activate
        objPasteData.WorkSheets("RawData").Select
        objExcel.ActiveSheet.UsedRange.Select
        usedRowCount2= objExcel.Selection.Rows.Count
    
        objPasteData.Worksheets("RawData").Range("A"& usedRowCount2 + 1 ).PasteSpecial Paste =xlValues
    
    Next
    objPasteData.Save
    

    Thanks @Nilpo & @rryanp for guidance.

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

Sidebar

Related Questions

Possible Duplicate: Copy column from one Excel sheet to another Excel sheet I have
Is it possible to copy data from column A to column B for all
I am copying several worksheets from one workbook to another. The first sheet contains
Is it possible to copy the value of a group into another one within
Is it possible to use Ant to copy all the files (not folders) from
I have a task of copying the data from one database to another.I don't
The following code is written to select some data from one file and copy
In django, I want to copy data from identical tables in one db to
i am running a number of small batch scripts to copy data from one
Is it possible to copy a folder present in sdcard to another folder present

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.