Code expanding Row Heights unexpectedly

delecto

New Member
Joined
Mar 3, 2009
Messages
15
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!

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
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Don't see anything obvious either. Step though the VBA after commenting out the ScreenUpdating line.

On the AutoSave, have you turned off AutoSave in Excels Options\Save ?
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,040
Members
449,063
Latest member
ak94

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top