Excel macro for consolidating workbooks

Posted by / 20-Feb-2020 21:05

", vb Information vb Yes No, "Error") If ans = vb No Then Exit Sub Go To Next I End If ' ----------------------------------------------------------------------------------------- ' Source book was found, data to use is on Data Output. ' ------------------------------------------------------------------------------------- ans = Msg Box("Could not find Source " & Get Source Name By Index(i) & " Workbook's 'Da" & _ "ta Output' tab." & vb New Line & "Do you wish to continue? Value Next n l Row = l Row 1 Loop End With Next I: wb.

' ----------------------------------------------------------------------------------------- With wb. ", _ vb Information vb Yes No, "Error") If ans = vb No Then wb. Close False Next i Set wb = Nothing End Sub Function Get Source Name By Index(By Val Index As Long) As String Select Case Index Case 1: Get Source Name By Index = "Pipeline ABC" Case 2: Get Source Name By Index = "Pipeline DEF" Case 3: Get Source Name By Index = "Pipeline GHI" End Select End Function Function Get Password By Index(By Val Index As Long) As String Select Case Index Case 1: Get Password By Index = "Pipeline ABC Password" Case 2: Get Password By Index = "Pipeline DEF Password" Case 3: Get Password By Index = "Pipeline GHI Password" End Select End Function Hi Rosen - it's working beautifully, except for one thing ...

I hope this is enough hypothetical information to enable you all to help me with the code. Regards, JHCali Hopefully I understood your request, there are still a few assumptions being made in my code. Clear ' ------------------------------------------------------------------------------------- ' No source workbook found, advise user.

' --------------------------------------------------------------------------------------- Do Until . Unfortunately, these are established workbooks so I can't change the name format.2) SOURCE WORKBOOKS PASSWORD PROTECTED Each of the source workbooks is password protected, and each has a different password.3) COLUMN HEADERS I don't want to copy/paste the column headers from any source workbooks, just the data.6) The destination file is titled "Destination.xls" 7) The file path where all the files are located is: "C:\Desktop\Week 1".Each wee I will create a new folder and update the number after the "Week".

excel macro for consolidating workbooks-28excel macro for consolidating workbooks-10excel macro for consolidating workbooks-33

How to merge excel files or combine excel files into a single sheet from a different workbook using excel macro is the topic of this blog.