This ought to be pretty easy.
I'm looking to speed up the execution of this code:
Sheets("Storage").Select
Range("StartHere").Select
Do Until ActiveCell.Value = ""
fnm = ActiveCell.Value
snm = ActiveCell.Offset(0, 1).Value
Workbooks(Currfile).Worksheets(snm).UsedRange.Clear
Workbooks.Open Filename:=Range("Input_folder").Value & "\" & fnm & ".xlsx"
With Range("A1").CurrentRegion
.WrapText = False
.ShrinkToFit = False
.UnMerge
End With
Workbooks(fnm).Worksheets("Sheet").UsedRange.Copy Workbooks(Currfile).Worksheets(snm).Range("A1")
Workbooks(fnm).Close SaveChanges:=False
Sheets("Storage").Select
ActiveCell.Offset(1, 0).Select
Loop
It loops through a list in a workbook tab, with a filename in column A and a corresponding sheetname in column B, copying the contents of the file to the corresponding sheet. I know there ought to be a way to read the names into an array and pull them from there, rather than selecting them from worksheet cells, but I don't have any experience in doing that, and I am looking to learn.
Thanks in advance.
I'm looking to speed up the execution of this code:
Sheets("Storage").Select
Range("StartHere").Select
Do Until ActiveCell.Value = ""
fnm = ActiveCell.Value
snm = ActiveCell.Offset(0, 1).Value
Workbooks(Currfile).Worksheets(snm).UsedRange.Clear
Workbooks.Open Filename:=Range("Input_folder").Value & "\" & fnm & ".xlsx"
With Range("A1").CurrentRegion
.WrapText = False
.ShrinkToFit = False
.UnMerge
End With
Workbooks(fnm).Worksheets("Sheet").UsedRange.Copy Workbooks(Currfile).Worksheets(snm).Range("A1")
Workbooks(fnm).Close SaveChanges:=False
Sheets("Storage").Select
ActiveCell.Offset(1, 0).Select
Loop
It loops through a list in a workbook tab, with a filename in column A and a corresponding sheetname in column B, copying the contents of the file to the corresponding sheet. I know there ought to be a way to read the names into an array and pull them from there, rather than selecting them from worksheet cells, but I don't have any experience in doing that, and I am looking to learn.
Thanks in advance.