Why copying ?
Why 2 commandbuttons ?
Why writing to the same drive where the OS resides ?
Public Sub CommandButton1_Click()
c00 = "E:\OF\"
c01 = txtCPNameBox.Text & "_mtm_portfolio_report.xls"
c02 = mtm_report_asof_" & Format(txtDateBox.Text, "yyyymmdd") & ".xls"
with workbooks.add
.saveas c00 & c01
end with
Workbooks.Open c00 & c02
c03 = Application.InputBox("Please highlight (or select) the area you want with your mouse", , , , , , , 8).Address
workbooks(c01).sheets(1).cells(1).resize(range(c03).rows.count,range(c03).columns.count)=workbooks(c02).sheets("MTM Detail").range(c03).value
End Sub
Bookmarks