I'm trying to build out a workbook (master) that opens a file (data) and imports all the tabs back into the master. I'm 99% there - except that the code is expanding the row heights to be 409 high. I ... have no idea why. So far, I can point to the "Data" file, it opens it up, copies each tab, prompts the save-as. But while it's doing it, both the data file and the resulting master file get all warped. From what I can tell, nothing below should be messing with the sheet formatting. I feel like I'm going nuts!
The other mini challenge is that all the darn files on my computer default to autosave - so Data is getting messed up each time i open it (luckily I have a backup).
TIA!
The other mini challenge is that all the darn files on my computer default to autosave - so Data is getting messed up each time i open it (luckily I have a backup).
TIA!
VBA Code:
Sub ImportDatafromotherworksheet2()
Dim wkbCrntWorkBook As Workbook
Dim wkbSourceBook As Workbook
Dim sourceWorksheet As Worksheet
Application.ScreenUpdating = False
Application.EnableEvents = False
Set wkbCrntWorkBook = ActiveWorkbook
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "Excel 2007-13", "*.xlsx; *.xlsm; *.xlsa"
.AllowMultiSelect = False
.Show
If .SelectedItems.Count > 0 Then
Workbooks.Open .SelectedItems(1)
Set wkbSourceBook = ActiveWorkbook
For Each sourceWorksheet In wkbSourceBook.Sheets
sourceWorksheet.Copy After:=wkbCrntWorkBook.Sheets(wkbCrntWorkBook.Sheets.Count)
Next
wkbSourceBook.Close savechanges:=False
End If
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Dialogs(xlDialogSaveAs).Show
End Sub