Results 1 to 44 of 44

Excel VBA: Problem with porting selected data from one excel workbook to another

Threaded View

  1. #1
    Registered User
    Join Date
    07-22-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    32

    Excel VBA: Problem with porting selected data from one excel workbook to another

    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!
    Last edited by arlu1201; 07-22-2013 at 09:36 AM. Reason: Use code tags in future.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Searching and porting data using a date range and Item ID
    By Aussie1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-01-2013, 01:36 PM
  2. Transfer selected data to another workbook...Excel 2003
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2012, 07:49 AM
  3. Porting VBA to Excel 2010 for 64-bit
    By 6StringJazzer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-18-2012, 10:51 PM
  4. [SOLVED] programatically retrieve selected rows from excel workbook
    By talktobatchu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-01-2005, 06:05 PM
  5. [SOLVED] Porting of Excel data to SQL Server 2000 remotely
    By Luke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2005, 03:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1