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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:40:44+00:00 2026-06-12T23:40:44+00:00

With the following code i am able to browse for multiple excel file’s at

  • 0

With the following code i am able to browse for multiple excel file’s at the same time and paste them on single sheet below each other so my problem is it copies everything including their headers but the thing is i only want it to copy the first file with headers and the rest it must copy only data not headers and paste it below each other because all their headers are the same.

example:eg1 NAME,SURNAME,AGE
Kgotso,Smith,20

eg2 NAME,SURNAME,AGE

brian,brown,32

Result : NAME,SURNAME,AGE

Kgotso,Smith,20

brian,brown,32

Sub Button4_Click()
    Dim fileStr As Variant
    Dim wbk1 As Workbook, wbk2 As Workbook
    Dim ws1 As Worksheet
     fileStr = Application.GetOpenFilename(FileFilter:="microsoft excel files (*.xlsx), *.xlsx", Title:="Get File", MultiSelect:=True)
    Set wbk1 = ActiveWorkbook
    Set ws1 = wbk1.Sheets("Sheet3")

    For i = 1 To UBound(fileStr)
    MsgBox fileStr(i), , GetFileName(CStr(fileStr(i)))
    Set wbk2 = Workbooks.Open(fileStr(i))
    wbk2.Sheets(1).UsedRange.Copy ws1.Cells(ws1.Range("A" & Rows.Count).End(xlUp).Row + 2, 1)
    wbk2.Close
    Next i

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-12T23:40:45+00:00Added an answer on June 12, 2026 at 11:40 pm

    This would be my quick attempt to this:

    Sub Button4_Click()
    Dim fileStr As Variant
    Dim wbk1 As Workbook, wbk2 As Workbook
    Dim ws1 As Worksheet
     fileStr = Application.GetOpenFilename(FileFilter:="microsoft excel files (*.xlsx), *.xlsx", Title:="Get File", MultiSelect:=True)
    Set wbk1 = ActiveWorkbook
    Set ws1 = wbk1.Sheets("Sheet3")
    
    'handling first file seperately
    MsgBox fileStr(1), , GetFileName(CStr(fileStr(1)))
    Set wbk2 = Workbooks.Open(fileStr(1))
    wbk2.Sheets(1).UsedRange.Copy ws1.Cells(ws1.Range("A" & Rows.Count).End(xlUp).Row + 2, 1)
    wbk2.Close
    
    For i = 2 To UBound(fileStr)
    MsgBox fileStr(i), , GetFileName(CStr(fileStr(i)))
    Set wbk2 = Workbooks.Open(fileStr(i))
    'using offset to skip the header - not the best solution,  but a quick one
    wbk2.Sheets(1).UsedRange.Offset(1,0).Copy ws1.Cells(ws1.Range("A" & Rows.Count).End(xlUp).Row + 2, 1)
    wbk2.Close
    Next i
    
    End Sub
    
    • 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 through which i am able to retrieve phone numbers.
Using the following code, I'm able to successfully open a raw disk on my
Using the following code, I am able to display up to 10 images. What
I have the following code for onPreviewFrame() Callback. It is now able to save
I have a test file that includes the following code. The page opens up
The following code creates 100 cookies and then enumerates through them via postbacks. protected
Using the jQuery Cycle plugin, the following code allows user to browse the photos/:
Trying to use the following Code to download a remote hosted .apk file. package
I have the follwing code, I m able to create a drop down list
Following code produces a nested array as a result for keys containing three items:

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.