ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 793
- Office Version
- 365
- 2019
- Platform
- Windows
Hello - The below VBA works BUT it is a tremendous resource grab. I think due to the fact i am selecting, copy and pasting for my loop. is there a more efficient way to just go direct on the copy and paste?
' Run loop and paste to Pre file
i = 1
Do Until Workbooks("COMPARSION").Sheets("Main").Range("Special").Offset(i, 0) = ""
Special = Workbooks("COMPARSION").Sheets("Main").Range("Special").Offset(i, 0)
Workbooks("ALL.xls").Sheets("Sec").Range("1VALUE") = Special
Application.Run "'ALL.xls'!SECALL"
Range("A11:X11").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks("PRE.xlsx").Activate
With Sheets("PRE").Range("A" & rows.count).End(xlUp).Offset(1)
.PasteSpecial Paste:=xlPasteValues
.PasteSpecial Paste:=xlPasteFormats
End With
i = i + 1
Loop
' Run loop and paste to Pre file
i = 1
Do Until Workbooks("COMPARSION").Sheets("Main").Range("Special").Offset(i, 0) = ""
Special = Workbooks("COMPARSION").Sheets("Main").Range("Special").Offset(i, 0)
Workbooks("ALL.xls").Sheets("Sec").Range("1VALUE") = Special
Application.Run "'ALL.xls'!SECALL"
Range("A11:X11").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks("PRE.xlsx").Activate
With Sheets("PRE").Range("A" & rows.count).End(xlUp).Offset(1)
.PasteSpecial Paste:=xlPasteValues
.PasteSpecial Paste:=xlPasteFormats
End With
i = i + 1
Loop