Hi guys,
I have an issue regarding porting data from one excel workbook to another workbook.
I want to select specific data from a specific sheet in an excel file and copy it into a new excel file.
ScreenShot005.jpg
e.g. copy C4 of excel1.xlsx into a new excel file excel2.xlsx
I've tried the following codes and links but to no avail:
Codes:
Private Sub CommandButton1_Click()
Dim oExcel as Excel.Application
Dim oWB as Workbook
Set oExcel = new Excel.Application
Set oWB = oExcel.Workbooks.Open(C:\Users\Sam\Desktop\MP Stuff\TP Monthly Report v0.xlsx)
Dim DateRange As Integer
Dim AcceptedCalls As Single
Dim PortedData As Workbook
Worksheets("sheet2").Select
'DateRange = Range("A4")
'DateRange = Range("B4" + "B27")
DateRange = Sum(B4, B27)
Set PortedData = Workbooks.Open("C:\Users\Sam\Desktop\MP Stuff\PortedData.xlsx")
Worksheets("sheet1").Select
Worksheets("sheet1").Range("A1").Select
RowCount = Worksheets("sheet1").Range("A1")
With Worksheets("Sheet1").Range("A1")
.Offset(RowCount, 0) = DateRange
.Offset(RowCount, 1) = AcceptedCalls
End With
PortedData.Save
End Sub
---------------------------
Links:
http://en.kioskea.net/faq/24666-exce...other-workbook
http://www.familycomputerclub.com/tr...excel-vba.html
Thanks in advance!
Bookmarks