• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Question

Susu

New Member
Hello,

I have a report that comes through email, as an attachment, and I have to open the Excel Attachment, Copy the first 8 tabs , and move them to a new spreadsheet, then open a different excel file from the share drive, copy 7 tabs, then move them the new spread sheet with 8 tabs. Now I will have 15 tabs in that new spreadsheet, save to the share drive and send as an email attachment.

I am new using VBA, I tried to search on google and I couldn't come up with anything, may you please assist me. I am actually learning VBA and new to the forum too.

Thank you all.
 
Workbooks.Open Filename:= _
"E:\Margin \Sheets\Test\ Display Sheets 7-24-15.xlsx"
Sheets(Array("Price ", "MSR ", "Agency ", _
"FN", "FH", "F", "VA ", "NonCon")). _
Select
Sheets("NonCon").Activate
Sheets(Array("Price ", "MSR ", "Agency ", _
"FN", "FH", "F", "VA ", "NonCon")). _
Copy Before:=Workbooks("Book1").Sheets(1)
Workbooks.Open Filename:="E:\Margin\Sheets\NCs.xlsx"
Sheets(Array("Lo", "FI", "State", "Crej", _
"Load", "TXH", "Occup", "Prop", "Term")).Select
Sheets("Load").Activate
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Lo", "FI", "State", "Crej", _
"Load", "TXH", "Occup", "Prop", "Term")).Select
Sheets("Term").Activate
Sheets(Array("Lo", "FI", "State", "Crej", _
"Load", "TXH", "Occup", "Prop", "Term")).Move _
Before:=Workbooks("Book1").Sheets(12)
Range("Q19").Select
Application.Dialogs(xlDialogSendMail).Show
ChDir "E:\Margin \Sheets"
End Sub
 
Back
Top