i have 4 different excel files of different names.
each excel file has 8 columns and 15 sheets.
All excel files has same columns and same number of sheets (same sheet names and column names)...
i have to merge these 4 files into one.
that file must be identical to the individual files.i.e same column names,and same number of sheets.
please do help me with that please.am a begginer in programming.
thanks in advance.
hope i can get the solution here...
please note am using excel 2003...:P

Recommended Answers

All 12 Replies

thanks for the quick reply.:)
am a bit lost with the codes.am a begginer in the programming field.am a student in the first year.
let me explain what i want to build.
i made an interface,with 5 buttons.
4 buttons each to upload a different excel files.
then the last button,when i click on it,it should merge my 4 files.
hope you're understanding what i want to do.
thanks a lot for your quick reply.
i really appreciate your help.:)

ok.. i have created the function for you.
here is the completed code.. i hope you understand..

Imports Microsoft.Office.Interop.Excel
Imports System.Data.OleDb
Public Class Form2
    Dim dsFinal As New DataSet
    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MergeExcelInDataSet("d:\Book1.xls", dsFinal)
        MergeExcelInDataSet("d:\Book2.xls", dsFinal)
        MergeExcelInDataSet("d:\Book3.xls", dsFinal)
        MergeExcelInDataSet("d:\Book4.xls", dsFinal)
        MergeExcelInDataSet("d:\Book5.xls", dsFinal)
        'all the excels are in dsFinal dataset now
        'we will export this dataset to excel
        ExportDatasetToExcel(dsFinal, "d:\my.xls")
    End Sub

    Public Sub MergeExcelInDataSet(ByVal strExcelFile As String, ByRef ds As DataSet)
        Dim objExcel As Microsoft.Office.Interop.Excel.Application
        Dim objWorkBook As Microsoft.Office.Interop.Excel.Workbook
        Dim tmpWorkSheet As Microsoft.Office.Interop.Excel.Worksheet

        objExcel = CreateObject("Excel.Application")
        objWorkBook = objExcel.Workbooks.Open(strExcelFile)

        Dim strSheetName(objWorkBook.Worksheets.Count - 1) As String
        Dim i As Integer = 0
        For Each tmpWorkSheet In objWorkBook.Worksheets
            strSheetName(i) = tmpWorkSheet.Name
            i += 1
        Next

        objExcel.Quit()
        releaseObject(objExcel)
        releaseObject(objWorkBook)
        releaseObject(tmpWorkSheet)


        Dim conn As New System.Data.OleDb.OleDbConnection(String.Format("provider=Microsoft.Jet.OLEDB.4.0; Data Source='{0}';" & "Extended Properties='Excel 8.0;HDR=YES;'", strExcelFile))
        For Each str As String In strSheetName
            Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from [" & str & "$]", conn)
            da.Fill(ds, str)
        Next

    End Sub

    Public Sub ExportDatasetToExcel(ByVal ds As DataSet, ByVal strExcelFile As String)

        Dim conn As New System.Data.OleDb.OleDbConnection(String.Format("provider=Microsoft.Jet.OLEDB.4.0; Data Source='{0}';" & "Extended Properties='Excel 8.0;HDR=YES;'", strExcelFile))
        conn.Open()

        Dim strTableQ(ds.Tables.Count) As String

        Dim i As Integer = 0

        'making table query
        For i = 0 To ds.Tables.Count - 1

            strTableQ(i) = "CREATE TABLE [" & ds.Tables(i).TableName & "]("

            Dim j As Integer = 0
            For j = 0 To ds.Tables(i).Columns.Count - 1
                Dim dCol As DataColumn
                dCol = ds.Tables(i).Columns(j)
                strTableQ(i) &= " [" & dCol.ColumnName & "] varchar(255) , "
            Next
            strTableQ(i) = strTableQ(i).Substring(0, strTableQ(i).Length - 2)
            strTableQ(i) &= ")"

            Dim cmd As New OleDbCommand(strTableQ(i), conn)
            cmd.ExecuteNonQuery()

        Next

        'making insert query
        Dim strInsertQ(ds.Tables.Count - 1) As String
        For i = 0 To ds.Tables.Count - 1
            strInsertQ(i) = "Insert Into " & ds.Tables(i).TableName & " Values ("
            For k As Integer = 0 To ds.Tables(i).Columns.Count - 1
                strInsertQ(i) &= "@" & ds.Tables(i).Columns(k).ColumnName & " , "
            Next
            strInsertQ(i) = strInsertQ(i).Substring(0, strInsertQ(i).Length - 2)
            strInsertQ(i) &= ")"
        Next

        'Now inserting data
        For i = 0 To ds.Tables.Count - 1
            For j As Integer = 0 To ds.Tables(i).Rows.Count - 1
                Dim cmd As New OleDbCommand(strInsertQ(i), conn)
                For k As Integer = 0 To ds.Tables(i).Columns.Count - 1
                    cmd.Parameters.AddWithValue("@" & ds.Tables(i).Columns(k).ColumnName.ToString(), ds.Tables(i).Rows(j)(k).ToString())
                Next
                cmd.ExecuteNonQuery()
                cmd.Parameters.Clear()

            Next
        Next
    End Sub

    Private Sub releaseObject(ByVal obj As Object)
        Try
            System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
            obj = Nothing
        Catch ex As Exception
            obj = Nothing
        Finally
            GC.Collect()
        End Try
    End Sub
End Class
Imports Microsoft.Office.Interop.Excel
Imports System.Data.OleDb
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenFileDialog1.ShowDialog()
        If OpenFileDialog1.FileName = OpenFileDialog2.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        ElseIf OpenFileDialog1.FileName = OpenFileDialog3.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        ElseIf OpenFileDialog1.FileName = OpenFileDialog4.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        Else
            TextBox1.Text = OpenFileDialog1.FileName
        End If

    End Sub

    Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        OpenFileDialog2.ShowDialog()
        If OpenFileDialog2.FileName = OpenFileDialog1.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        ElseIf OpenFileDialog2.FileName = OpenFileDialog3.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        ElseIf OpenFileDialog2.FileName = OpenFileDialog4.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        Else
            TextBox2.Text = OpenFileDialog2.FileName
        End If
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        OpenFileDialog3.ShowDialog()
        If OpenFileDialog3.FileName = OpenFileDialog1.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        ElseIf OpenFileDialog3.FileName = OpenFileDialog2.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        ElseIf OpenFileDialog3.FileName = OpenFileDialog4.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        Else
            TextBox3.Text = OpenFileDialog3.FileName
        End If
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        OpenFileDialog4.ShowDialog()
        If OpenFileDialog4.FileName = OpenFileDialog1.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        ElseIf OpenFileDialog4.FileName = OpenFileDialog2.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        ElseIf OpenFileDialog4.FileName = OpenFileDialog3.FileName Then
            MessageBox.Show("File already uploaded!", "Try again", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        Else
            TextBox4.Text = OpenFileDialog4.FileName
        End If
    End Sub

    

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Dim oExcel As Object = CreateObject("Excel.Application")
        '*******************************************************************************************************


        Dim dsFinal As New DataSet

        MergeExcelInDataSet(OpenFileDialog1.FileName, dsFinal)
        MergeExcelInDataSet(OpenFileDialog2.FileName, dsFinal)
        MergeExcelInDataSet(OpenFileDialog3.FileName, dsFinal)
        MergeExcelInDataSet(OpenFileDialog4.FileName, dsFinal)
        'MergeExcelInDataSet("d:\Book5.xls", dsFinal)
        'all the excels are in dsFinal dataset now
        'we will export this dataset to excel
        ExportDatasetToExcel(dsFinal, "C:\Documents and Settings\kSZZ6157\Desktop\Merge.xls")
    End Sub

    Public Sub MergeExcelInDataSet(ByVal strExcelFile As String, ByRef ds As DataSet)
        Dim objExcel As Microsoft.Office.Interop.Excel.Application
        Dim objWorkBook As Microsoft.Office.Interop.Excel.Workbook
        Dim tmpWorkSheet As Microsoft.Office.Interop.Excel.Worksheet

        objExcel = CreateObject("Excel.Application")
        objWorkBook = objExcel.Workbooks.Open(strExcelFile)

        Dim strSheetName(objWorkBook.Worksheets.Count - 1) As String
        Dim i As Integer = 0
        For Each tmpWorkSheet In objWorkBook.Worksheets
            strSheetName(i) = tmpWorkSheet.Name
            i += 1
        Next

        objExcel.Quit()
        releaseObject(objExcel)
        releaseObject(objWorkBook)
        releaseObject(tmpWorkSheet)


        Dim conn As New System.Data.OleDb.OleDbConnection(String.Format("provider=Microsoft.Jet.OLEDB.4.0; Data Source='{0}';" & "Extended Properties='Excel 8.0;HDR=YES;'", strExcelFile))
        For Each str As String In strSheetName
            Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from [" & str & "$]", conn)
            da.Fill(ds, str)
        Next

    End Sub

    Public Sub ExportDatasetToExcel(ByVal ds As DataSet, ByVal strExcelFile As String)

        Dim conn As New System.Data.OleDb.OleDbConnection(String.Format("provider=Microsoft.Jet.OLEDB.4.0; Data Source='{0}';" & "Extended Properties='Excel 8.0;HDR=YES;'", strExcelFile))
        conn.Open()

        Dim strTableQ(ds.Tables.Count) As String

        Dim i As Integer = 0

        'making table query
        For i = 0 To ds.Tables.Count - 1

            strTableQ(i) = "CREATE TABLE [" & ds.Tables(i).TableName & "]("

            Dim j As Integer = 0
            For j = 0 To ds.Tables(i).Columns.Count - 1
                Dim dCol As DataColumn
                dCol = ds.Tables(i).Columns(j)
                strTableQ(i) &= " [" & dCol.ColumnName & "] varchar(255) , "
            Next
            strTableQ(i) = strTableQ(i).Substring(0, strTableQ(i).Length - 2)
            strTableQ(i) &= ")"

            Dim cmd As New OleDbCommand(strTableQ(i), conn)
            cmd.ExecuteNonQuery()

        Next

        'making insert query
        Dim strInsertQ(ds.Tables.Count - 1) As String
        For i = 0 To ds.Tables.Count - 1
            strInsertQ(i) = "Insert Into " & ds.Tables(i).TableName & " Values ("
            For k As Integer = 0 To ds.Tables(i).Columns.Count - 1
                strInsertQ(i) &= "@" & ds.Tables(i).Columns(k).ColumnName & " , "
            Next
            strInsertQ(i) = strInsertQ(i).Substring(0, strInsertQ(i).Length - 2)
            strInsertQ(i) &= ")"
        Next

        'Now inserting data
        For i = 0 To ds.Tables.Count - 1
            For j As Integer = 0 To ds.Tables(i).Rows.Count - 1
                Dim cmd As New OleDbCommand(strInsertQ(i), conn)
                For k As Integer = 0 To ds.Tables(i).Columns.Count - 1
                    cmd.Parameters.AddWithValue("@" & ds.Tables(i).Columns(k).ColumnName.ToString(), ds.Tables(i).Rows(j)(k).ToString())
                Next
                cmd.ExecuteNonQuery()
                cmd.Parameters.Clear()

            Next
        Next
    End Sub

    Private Sub releaseObject(ByVal obj As Object)
        Try
            System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
            obj = Nothing
        Catch ex As Exception
            obj = Nothing
        Finally
            GC.Collect()
        End Try

        '*******************************************************************************************************

        'progress = i / oSheet.UsedRange.Rows.Count
        'ProgressBar1.Value = progress * ProgressBar1.Maximum

        '    Me.Text = "Excel Extractor " & Int(progress * 100) & " %"


        For i = 0 To sWorksheets.Length - 1
            'Add the pivot table on each worksheet

            Dim sheet As Object = sWorksheets(i)
            Dim range As Object = sheet.Range("A1:H" & sheet.UsedRange.Rows.Count)
            Dim pivotDestination As Object = sheet.Range("K1") 'The pivot table will appear there
            Dim pivotTableName As String = sWorksheetNames(i)

            Dim pCache As Object

            Try
                pCache = sBook.PivotCaches.Add(1, range) 'Office 2003
            Catch
                pCache = sBook.PivotCaches.Create(1, range, 1) 'Office 2007
            End Try

            Dim pTable As Object = pCache.CreatePivotTable(pivotDestination, pivotTableName,
                                                                     DefaultVersion:=1)

            Dim pivotTable As Object = sheet.PivotTables(pivotTableName)

            'Choose only impact L1 and Impacted services

            Dim impactL1 As Object = pivotTable.PivotFields("Impact L1")
            Dim impactServices As Object = pivotTable.PivotFields("Impacted_Services")

            impactServices.Orientation = 1 'Row Field
            impactServices.Position = 1
            impactServices.Name = "IMPACTED SERVICES"

            pivotTable.AddDataField(impactL1, "Count of Impact L1", -4112)

            impactL1.Orientation = 2 'Column Field
            impactL1.Position = 1

            'Style the pivot table
            With pivotTable.TableRange2
                'Style top part
                Dim header As Object = .Rows(1)
                header.Interior.ColorIndex = 13
                header.Interior.Pattern = 1 'xlSolid
                header.Font.ColorIndex = 1

                'Add borders
                .Borders(5).LineStyle = -4142  'xlDiagonalDown 'xlNone
                .Borders(6).LineStyle = -4142  'xlDiagonalUp  'xlNone
                For b = 7 To 12 'xlEdgeLeft  xlEdgeTop  xlEdgeBottom  xlEdgeRight  xlInsideVertical  xlInsideHorizontal
                    Dim border As Object = .Borders(b)
                    border.LineStyle = 1 'xlContinuous
                    border.Weight = 2 'xlThin
                    border.ColorIndex = -4105 ' xlAutomatic
                Next

            End With

            'Format, style the cells

            Dim data_range As Object = sheet.Cells.Range("A1:H" & sheet.UsedRange.Rows.Count)

            'Method 1  -- Put data into a table
            sheet.ListObjects.Add(1, data_range, , 1, )


            With sheet.Cells.Range("A1:H1")
                .Interior.ColorIndex = 11
                .Interior.Pattern = 1 'xlSolid
                .Font.Italic = True
                .Font.ColorIndex = 2
                .Font.Bold = True
            End With


            'Reposition the pivot table above the data cells
            'Add some space above the data cells
            Dim pTrange As Object = pivotTable.TableRange2
            sheet.Range("1:" & pTrange.Rows.Count + 4). _
                Insert(-4121, 0)

            CellCol = pTrange.Columns.Count
            CellRows = pTrange.Rows.Count

            'Move the data
            pTrange.Copy(sheet.Cells(2, 2))
            pTrange.Delete()

            For iLoop = 3 To CellCol + 1
                If sheet.Cells(3, iLoop).text.ToString().ToUpper().Equals("YES") Then
                    YesCol = iLoop
                End If

                If sheet.Cells(3, iLoop).text.ToString().ToUpper().Equals("GRAND TOTAL") Then
                    TotalCol = iLoop
                End If
            Next

            sheet.Cells(2, CellCol + 2).Borders.Weight = 2
            'sheet.Cells(2, CellCol + 2).Borders.Color = Color.DarkMagenta
            sheet.Cells(2, CellCol + 2).Interior.Color = Color.DarkMagenta

            sheet.Cells(3, CellCol + 2) = "% Autonomy"
            sheet.Cells(3, CellCol + 2).Borders.Weight = 2
            'sheet.Cells(3, CellCol + 2).Borders.Color = Color.DarkViolet
            sheet.Cells(3, CellCol + 2).Font.Color = Color.White
            sheet.Cells(3, CellCol + 2).Font.Bold = True

            sheet.Cells(3, CellCol + 2).Interior.Color = Color.DarkMagenta

            For iLoop = 4 To CellRows + 1
                Integer.TryParse(sheet.Cells(iLoop, YesCol).text, sOperand)
                Integer.TryParse(sheet.Cells(iLoop, TotalCol).text, sDivisor)

                If (sOperand > 0 And sDivisor > 0) Then
                    sheet.Cells(iLoop, CellCol + 2) = Math.Round(sOperand / sDivisor, 4) * 100
                End If

                sheet.Cells(iLoop, CellCol + 2).Borders.Weight = 2
            Next

        Next


        'Now lets save the workbook
        'If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
        'sBook.SaveAs(SaveFileDialog1.FileName)
        'End If

        'close everything
        'If Not sBook Is Nothing Then
        'sBook.Close()
        'End If
        'oBook.Close()

        'Clear all objects and free memory

        'oExcel.Quit()
        MessageBox.Show("Merge Done!", "Complete", MessageBoxButtons.OK, MessageBoxIcon.Information)
    End Sub

End Class

but this will not work for MS Excel 2003.
This "Imports Microsoft.Office.Interop.Excel" works only on excel 2007 and above.:/
by the ways thanks a lot for your time and your reply..don't know how to thank you enough for that..:)
am really grateful to you.:)

Region Lobby Group Impact L1 Gene_id Customer name Case severity Impacted_Services Comments

here is my table colums in each of the 4 excel sheet.
i have to merge the tables from all 4.

here i have change the code. now we will not use the Microsoft.Office.interop.excel

we will only use Oledb

new code: (mainly the MergeExcelInDataSet function has changed)

Imports System.Data.OleDb
Public Class Form3_withOledb

    Private Sub Form3_withOledb_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim dsFinal As New DataSet
        MergeExcelInDataSet("d:\Book1.xls", dsFinal)
        MergeExcelInDataSet("d:\Book2.xls", dsFinal)
        MergeExcelInDataSet("d:\Book3.xls", dsFinal)
        MergeExcelInDataSet("d:\Book4.xls", dsFinal)
        MergeExcelInDataSet("d:\Book5.xls", dsFinal)
        'all the excels are in dsFinal dataset now
        'we will export this dataset to excel
        ExportDatasetToExcel(dsFinal, "d:\my.xls")

    End Sub

    Public Sub MergeExcelInDataSet(ByVal strExcelFile As String, ByRef ds As DataSet)
        Dim conn As New System.Data.OleDb.OleDbConnection(String.Format("provider=Microsoft.Jet.OLEDB.4.0; Data Source='{0}';" & "Extended Properties='Excel 8.0;HDR=YES;'", strExcelFile))

        conn.Open()
        Dim dt As New DataTable
        dt = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)

        Dim strSheetName(dt.Rows.Count - 1) As String
        Dim i As Integer = 0
        For i = 0 To dt.Rows.Count - 1
            strSheetName(i) = dt.Rows(i)("TABLE_NAME")
        Next

        For Each str As String In strSheetName
            Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from [" & str & "]", conn)
            da.Fill(ds, str)
        Next

    End Sub

    Public Sub ExportDatasetToExcel(ByVal ds As DataSet, ByVal strExcelFile As String)

        Dim conn As New System.Data.OleDb.OleDbConnection(String.Format("provider=Microsoft.Jet.OLEDB.4.0; Data Source='{0}';" & "Extended Properties='Excel 8.0;HDR=YES;'", strExcelFile))
        conn.Open()

        Dim strTableQ(ds.Tables.Count) As String

        Dim i As Integer = 0

        'making table query
        For i = 0 To ds.Tables.Count - 1

            strTableQ(i) = "CREATE TABLE [" & ds.Tables(i).TableName.Replace("$", "") & "]("

            Dim j As Integer = 0
            For j = 0 To ds.Tables(i).Columns.Count - 1
                Dim dCol As DataColumn
                dCol = ds.Tables(i).Columns(j)
                strTableQ(i) &= " [" & dCol.ColumnName & "] varchar(255) , "
            Next
            strTableQ(i) = strTableQ(i).Substring(0, strTableQ(i).Length - 2)
            strTableQ(i) &= ")"

            Dim cmd As New OleDbCommand(strTableQ(i), conn)
            cmd.ExecuteNonQuery()

        Next

        'making insert query
        Dim strInsertQ(ds.Tables.Count - 1) As String
        For i = 0 To ds.Tables.Count - 1
            strInsertQ(i) = "Insert Into " & ds.Tables(i).TableName & " Values ("
            For k As Integer = 0 To ds.Tables(i).Columns.Count - 1
                strInsertQ(i) &= "@" & ds.Tables(i).Columns(k).ColumnName & " , "
            Next
            strInsertQ(i) = strInsertQ(i).Substring(0, strInsertQ(i).Length - 2)
            strInsertQ(i) &= ")"
        Next

        'Now inserting data
        For i = 0 To ds.Tables.Count - 1
            For j As Integer = 0 To ds.Tables(i).Rows.Count - 1
                Dim cmd As New OleDbCommand(strInsertQ(i), conn)
                For k As Integer = 0 To ds.Tables(i).Columns.Count - 1
                    cmd.Parameters.AddWithValue("@" & ds.Tables(i).Columns(k).ColumnName.ToString(), ds.Tables(i).Rows(j)(k).ToString())
                Next
                cmd.ExecuteNonQuery()
                cmd.Parameters.Clear()

            Next
        Next
    End Sub

    
End Class

i get this error when i run

The Microsoft Jet database engine could not find the object ''MOBILE MAIL'$_FilterDatabase'. Make sure the object exists and that you spell its name and the path name correctly.

For Each str As String In strSheetName
            Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from [" & str & "]", conn)
            da.Fill(ds, str) 'HERE
        Next

hi
i show you excel file.

do you want all the sheet with same name in different excels files to be merged into single sheet with all the data??

hi..
no infact i want a new excel workbook that look the same as as the small ones.
just that all the data has been merged.
its format must stay the same.
i.e the final workbook must have the 15 sheets with same names.
and its pivot table too.
are you getting my point?
thanks

does all your 5 excel sheets have same sheet name?

does all your 5 excel sheets have same sheet name?

yes..they are identical workbook..just data are diferent.
same headers ,same format ,same sheet names..

Just trying my Luck
Hey diven and other kind souls,

Im doing something quite similar to what you were doing. except mine is like "comb merging" 2 files & another 2 files place in a certain location. so Total 4 excel files into 1 excel file.
Additional Info : Each file has only 1 sheet. So final output in 1 sheet as well

Would be really helpful if you could share your final outcome / guide me on how to tweak the code to achieve my output.


Before discovering your thread i created mine..you people
http://www.daniweb.com/software-development/vbnet/threads/395931/1698548#post1698548

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.