Free for PREMIUM members
...is this possible?
Dim Paths As Variant
Dim xPath As Variant
Dim WbName As String
Dim SourceWb As Workbook
Dim SourceWs As Worksheet
Dim DestWb As Workbook
Dim DestWs As Worksheet
Dim WbWasOpen As Boolean
Dim Counter As Long
Dim LastR As Long
Paths = Application.GetOpenFilename("Excel files, *.xls*", , "Select project files", , True)
If IsArray(Paths) = False Then
MsgBox "You didn't select any files, aborting", vbCritical, "Invalid Entry"
Set DestWb = Workbooks.Add
Set DestWs = DestWb.Worksheets(1)
For Each xPath In Paths
WbName = Mid(xPath, InStrRev(xPath, "\") + 1)
On Error Resume Next
Set SourceWb = Workbooks(WbName)
If Err = 0 Then
WbWasOpen = True
WbWasOpen = False
Set SourceWb = Workbooks.Open(xPath)
On Error GoTo 0
Set SourceWs = SourceWb.Worksheets(1)
If Counter = 0 Then
Counter = 1
LastR = .Cells(.Rows.Count, 1).End(xlUp).Row
If LastR > 1 Then
Counter = Counter + 1
.Rows(LastR).Copy DestWs.Cells(Counter, 1)
If Not WbWasOpen Then SourceWb.Close False
Open in new window
Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.