+ Reply to Thread
Results 1 to 44 of 44

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

Hybrid View

hahas018 Excel VBA: Problem with... 07-22-2013, 09:13 AM
Solus Rankin Re: Excel VBA: Problem with... 07-22-2013, 09:36 AM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 12:18 PM
Solus Rankin Re: Excel VBA: Problem with... 07-22-2013, 12:32 PM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 12:41 PM
Solus Rankin Re: Excel VBA: Problem with... 07-22-2013, 12:43 PM
Norie Why are you creating a new... 07-22-2013, 12:53 PM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 01:24 PM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 01:18 PM
Norie Re: Excel VBA: Problem with... 07-22-2013, 01:32 PM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 01:36 PM
Norie Re: Excel VBA: Problem with... 07-22-2013, 01:39 PM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 02:23 PM
Norie Re: Excel VBA: Problem with... 07-22-2013, 02:32 PM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 02:52 PM
Norie Re: Excel VBA: Problem with... 07-22-2013, 03:39 PM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 09:40 PM
Norie Re: Excel VBA: Problem with... 07-22-2013, 10:16 PM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 10:26 PM
Norie Re: Excel VBA: Problem with... 07-22-2013, 10:35 PM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 10:39 PM
Norie Re: Excel VBA: Problem with... 07-22-2013, 10:43 PM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 10:54 PM
Norie Re: Excel VBA: Problem with... 07-22-2013, 11:00 PM
hahas018 Re: Excel VBA: Problem with... 07-22-2013, 11:17 PM
Norie Re: Excel VBA: Problem with... 07-22-2013, 11:25 PM
hahas018 Re: Excel VBA: Problem with... 07-23-2013, 12:35 AM
Norie Re: Excel VBA: Problem with... 07-23-2013, 12:43 AM
hahas018 Re: Excel VBA: Problem with... 07-23-2013, 01:10 AM
Norie Re: Excel VBA: Problem with... 07-23-2013, 01:14 AM
hahas018 Re: Excel VBA: Problem with... 07-23-2013, 01:24 AM
Norie Re: Excel VBA: Problem with... 07-23-2013, 01:33 AM
hahas018 Re: Excel VBA: Problem with... 07-23-2013, 01:57 AM
Norie Re: Excel VBA: Problem with... 07-23-2013, 02:13 AM
hahas018 Re: Excel VBA: Problem with... 07-23-2013, 09:09 AM
Norie Re: Excel VBA: Problem with... 07-23-2013, 09:17 AM
hahas018 Re: Excel VBA: Problem with... 07-23-2013, 09:28 AM
Norie Re: Excel VBA: Problem with... 07-23-2013, 09:34 AM
hahas018 Re: Excel VBA: Problem with... 07-23-2013, 09:46 AM
Norie Re: Excel VBA: Problem with... 07-23-2013, 09:58 AM
hahas018 Re: Excel VBA: Problem with... 07-23-2013, 12:56 PM
hahas018 Re: Excel VBA: Problem with... 08-19-2013, 05:43 AM
hahas018 Re: Excel VBA: Problem with... 08-19-2013, 05:47 AM
hahas018 Re: Excel VBA: Problem with... 08-19-2013, 05:46 AM
  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.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

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

    You declared AcceptedCalls as single but I don't see where the variable is set, so it will probably default to 0.


    BTW when posting code please use code tags. Highlight your code and press the # button in the toolbar.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

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

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

    hmmm so how do i go about doing it? I'm new to vba haha.

    aite, noted!

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

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

    What are the AcceptedCalls? Is it numbers you get from a range? From an inputbox? What do they represent?

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

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

    erm, it's the sum of 2 columns placed into a new column on a new excel file. Will it be better for you if i upload my source file for you to view??

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

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

    Yes I think it would.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    Why are you creating a new instance of Excel?

    Is the code not located in Excel?
    If posting code please use code tags, see here.

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

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

    Quote Originally Posted by Norie View Post
    Why are you creating a new instance of Excel?

    Is the code not located in Excel?

    It is because i want to create a function that can detect the source file, select the necessary data and port it into a new excel file as a report
    http://www.excelforum.com/attachment...5&d=1374498800

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

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

    This is the source file:
    http://www.4shared.com/file/Wt_gpxc8...ourceData.html

    I want to select data from sheet2 in the source file and port them over to the new excel file(called PortedData.xlsx) such that:
    ScreenShot005.jpg

    - Drop calls will always be 0
    - Accepted calls will be a sum of values from the source file columns,
    e.g.
    Date Accepted Calls Dropped Calls
    A4 B4 + B27 0
    A5 B5 + B28 0
    A6 B6 + B29 0
    A7 B7 + B30 0
    A8 B8 + B31 0

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    So this code isn't in Excel, it's in an executable?

    By the way, how are you detecting the source file?

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

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

    Quote Originally Posted by Norie View Post
    So this code isn't in Excel, it's in an executable?

    By the way, how are you detecting the source file?
    nope, all 3 files will be in excel
    There will be a command button inside the "executable" excel file and all the processing codes have to be in it

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    Then there's no need to create another instance of Excel, and doing so can cause problems when copying/pasting.

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

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

    Quote Originally Posted by Norie View Post
    Then there's no need to create another instance of Excel, and doing so can cause problems when copying/pasting.
    Erm, i need to have a "3-tier" system because
    the source file is a file with raw data generated from a Microsoft Access function. You might suggest that we could just change the queries in the Microsoft Access to suit my end product, however it'll be messy if everything is ported straight from the Microsoft Access as you can see in the previous posts, there're addition of columns. I hope that explains my need for another instance of excel. haha

  14. #14
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    Sorry, I still don't see why you need another instance of Excel.

    Why can't you have all the 3 workbooks in the same instance?
    Option Explicit
    
    Private Sub CommandButton1_Click()
    Dim wbReport As Workbook
    Dim PortedData As Workbook
    Dim DateRange As Long
    Dim AcceptedCalls As Single
    Dim RowCount As Long
    
        Set wbReport = Workbooks.Open("C:\Users\Sam\Desktop\MP Stuff\TP Monthly Report v0.xlsx")
    
        DateRange = wbReport.Worksheets("sheet2").Range("B4").Value + wbReport.Worksheets("sheet2").Range("B27").Value
    
        Set PortedData = Workbooks.Open("C:\Users\Sam\Desktop\MP Stuff\PortedData.xlsx")
    
        With PortedData
            RowCount = .Worksheets("Sheet1").Range("A1")
            With .Worksheets("Sheet1").Range("A1")
                .Offset(RowCount, 0) = DateRange
                .Offset(RowCount, 1) = AcceptedCalls
            End With
            .Save
        End With
    
        PortedData.Close SaveChanges:=True
        wbReport.Close SaveChanges:=True
    
    End Sub

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

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

    The least i can afford is 2 excel files - Source and Executable file.
    It is impossible to store everything because the actual source file have 16 sheets in it and I need a separate executable excel file to select the source file because it'll be a different source file every month (I'm kind of doing a monthly report program).

  16. #16
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    Sorry, but nothing you've posted explains why you need another, separate instance of Excel.

    Everything you describe could be achieved within one instance.

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

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

    Quote Originally Posted by Norie View Post
    Sorry, but nothing you've posted explains why you need another, separate instance of Excel.

    Everything you describe could be achieved within one instance.
    ermmm ok, but how do we go about doing your method???

  18. #18
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    Did you see the code I posted?

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

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

    Quote Originally Posted by Norie View Post
    Did you see the code I posted?
    yeap i did, but it doesn't work. It shows this error message: Runtime error'9': Subscript out of range

    and the debugger highlights this part of the code:

    DateRange = wbReport.Worksheets("sheet2").Range("B4").Value + wbReport.Worksheets("sheet2").Range("B27").Value
    and yes, what i meant was like the codes you provided - all the vba codes into one excel file but there will be 3 excel files (the monthly report, porteddata.xlsx and the excel file with the vba codes).
    Last edited by hahas018; 07-22-2013 at 10:28 PM.

  20. #20
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    I based the code on the code you posted, and that includes sheet and workbook names.

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

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

    hmmm ok, the only output i get is the opening of the TP Monthly Report v0.xlsx file and the code stops running after that with the error message

  22. #22
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    Like I said I based it on your code.

    If that code didn't have the correct sheet names then you would get the 'Subscript out of range error(s).

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

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

    Quote Originally Posted by Norie View Post
    Like I said I based it on your code.

    If that code didn't have the correct sheet names then you would get the 'Subscript out of range error(s).
    Oh so that's how the 'Subscript out of range' error comes about. Ermm, but i still get the error even after i changed it to the correct sheet (Sheet3). Mind having a look at my excel file?
    http://www.4shared.com/file/Wt_gpxc8...ourceData.html

    PS: This file is the same as monthly_report.xlsx

  24. #24
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    The link isn't valid.

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

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

    oh damn, do you have any other websites that i can upload my files??

  26. #26
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    I normally use Box.net.

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

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


  28. #28
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    There is no worksheet with the name 'Sheet3'.

    The worksheets are called '1', '2', '3' and 'Definition.

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

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

    Quote Originally Posted by Norie View Post
    There is no worksheet with the name 'Sheet3'.

    The worksheets are called '1', '2', '3' and 'Definition.
    Yes! It's working now even though it's not my desired output. I'll try to work my way round, thanks a lot! :D

  30. #30
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    What is your desired output?

    That's something you haven't really fully outlined.

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

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

    Quote Originally Posted by Norie View Post
    What is your desired output?

    That's something you haven't really fully outlined.
    Erm it's pretty much like this
    http://www.excelforum.com/attachment...8&d=1374512476

    I want to put them into a table in the output file

  32. #32
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    So where does this data come from?

    Are you appending data from another worksheet?

    Is it always just one row of values per file?

    By the way, I thought this had something to do with data exported from Access.

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

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

    This data comes from CallsSourceData.xlsx

    Yes I'm appending data from another worksheet

    Nope, it's more than that and it's selective

    The CallsSourceData.xlsx is generated from Access.

  34. #34
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    Are you going to tell us what data you are pulling or do we have to guess?

    By the way, didn't you say the filename was always changing and that one of the things you had to do was find the file?

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

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

    I guess I'll have to provide some background then.

    I'm a student doing my internship at my school's call centre. My group is doing a project for the centre to reduce the number of human errors in monthly reports. This is the outline of my plan:

    ScreenShot005.jpg
    TP Monthly Report.xlsx - https://app.box.com/s/yiglyg181ta8n9dm6ei3
    ExecutableFile.xlsm - https://app.box.com/s/ofckwxn8uzzcmbt9jeyk

    The source file - 'TP Monthly Report.xlsx' - will be generated by a Microsoft Access function. The proper file name for it is actually 'TP Monthly Report [Month].xlsx' ,thus I need a function that can prompt a dialog box to choose the source file instead of modifying the code every month.

    The ExecutableFile.xlsm is the main thing in this entire process. By right, it's suppose to prompt a dialog box to choose the source file but right now it's hard coded. This executable file will pull data from different sheets in the source file and paste them into the output file. Below are some examples:
    ScreenShot006.jpg
    ScreenShot007.jpg

    This is my code progress so far:
    Option Explicit
    
    Private Sub CommandButton1_Click()
    Dim wbReport As Workbook
    Dim PortedData As Workbook
    Dim DateRange As Long
    Dim AcceptedCalls As Single
    Dim RowCount As Long
    Dim PortedData2 As Object
    Dim sheetno As Integer
    
        Set wbReport = Workbooks.Open("C:\Users\Sam\Desktop\MP Stuff\TP Monthly Report.xlsx")
    
        DateRange = wbReport.Worksheets("2").Range("B4").Value + wbReport.Worksheets("2").Range("B27").Value
    
        'Set PortedData = Workbooks.Open("C:\Users\Sam\Desktop\MP Stuff\PortedData.xlsx")
        Set PortedData2 = CreateObject("EXCEL.APPLICATION")
        Set PortedData = PortedData2.Workbooks.Add
        
        'PortedData.Worksheets.Add Count:="1"
        
        sheetno = 1
        PortedData.Worksheets(sheetno).Activate
        With PortedData
            RowCount = .Worksheets("Sheet1").Range("A1")
            With .Worksheets("Sheet1").Range("A1")
                .Offset(RowCount, 0) = DateRange
                .Offset(RowCount, 1) = AcceptedCalls
            End With
        End With
        
        PortedData.SaveAs ("C:\Users\Sam\Desktop\MP Stuff\test.xlsx")
        
    
        PortedData.Close SaveChanges:=True
        wbReport.Close SaveChanges:=True
    
    End Sub
    Right now, my output is this:
    testxlsx.jpg


    My expected output will be something like this excel file - https://app.box.com/s/9zoetex1zxd2ll82fmxw
    I want those selected data to be placed into a table in the output excel file. Is it possible to do that??


    PS: I hope this roughly paint a picture of what I'm doing haha.

  36. #36
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    I really don't see why there are 3 workbooks involved, that might even increase the likelihood of errors.

    And you definitely shouldn't be using 2 instances of Excel.

    Anyways, if you want to be able to pick the Monthly Report file you should take a look at Application.GetOpenFilename.

    That would show a dialog where the user can navigate to and select the file.

    It returns the file name of the selected file which you can then open.

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

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

    The main thing is the ExecutableFile.xlsm ,it stores all the processing code - there is no function/code in the source and output file.

    Oh ok thanks, i'll look up on the Application.GetOpenFilename function!

    And how do I go about creating tables in the output file and put the selected data into them???

  38. #38
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    Why not copy the tables from the input file?

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

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

    Quote Originally Posted by Norie View Post
    Why not copy the tables from the input file?
    It's because I only need the selected data and there's some addition of columns that needs to be done. Did you have a look at the attachments??

  40. #40
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

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

    I looked at the attachments and to be honest I've no idea what data you want to copy or where you want to copy it to.

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

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

    Erm these are the data i want to copy over from the source excel file.

    Attachment 252221
    Attachment 252222

    What i meant in the pictures is that I want to create tables in the output file and fill them up with the selected values (e.g. A4 from sheet 2 of TP Monthly Report.xlsx). The rest of the columns such as 'Dropped Calls' will be hard-coded.

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

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

    Hey guys, i've solved this part already. I'll post the code here in case anyone wants to reference it (it's hard-coded):

    PHP Code: 
    Option Explicit

    Private Sub CommandButton1_Click()
    Dim wbReport As Workbook
    Dim wbSource 
    As Variant
    Dim PortedData 
    As Workbook

    'Table1 -Service Desk Monitoring Variables
    Dim AcceptedCalls1 As Long
    Dim AcceptedCalls2 As Long
    Dim AcceptedCalls3 As Long
    Dim AcceptedCalls4 As Long
    Dim AcceptedCalls5 As Long
    Dim DateRange1 As String
    Dim DateRange2 As String
    Dim DateRange3 As String
    Dim DateRange4 As String
    Dim DateRange5 As String
    Dim DroppedCalls As Single

    '
    Table2 -Customer Reporting Source Variables
    Dim Tickets1 
    As Long
    Dim Tickets2 
    As Long
    Dim Tickets3 
    As Long

    'Table3 -Service Request Tickets(IIT) Variables
    Dim SRDate1 As String
    Dim SRDate2 As String
    Dim SRDate3 As String
    Dim SRDate4 As String
    Dim SRDate5 As String
    Dim SRTickets1 As Long
    Dim SRTickets2 As Long
    Dim SRTickets3 As Long
    Dim SRTickets4 As Long
    Dim SRTickets5 As Long
    Dim TotalSRTickets As Long
    Dim SRResponseTime As String

    '
    Table4 -Incident Tickets(IITVariables
    Dim INDate1 
    As String
    Dim INDate2 
    As String
    Dim INDate3 
    As String
    Dim INDate4 
    As String
    Dim INDate5 
    As String
    Dim INTickets1 
    As Long
    Dim INTickets2 
    As Long
    Dim INTickets3 
    As Long
    Dim INTickets4 
    As Long
    Dim INTickets5 
    As Long
    Dim INResponseTime 
    As String

    'Table5 -Top Incidents(IIT) Variables

    '
    Table6 -Top Service Requests(IIT)

    'Table7 -Service Request Tickets(AAO)
    Dim AAOSRdate1 As String
    Dim AAOSRdate2 As String
    Dim AAOSRdate3 As String
    Dim AAOSRdate4 As String
    Dim AAOSRdate5 As String
    Dim AAOSRtix1 As Long
    Dim AAOSRtix2 As Long
    Dim AAOSRtix3 As Long
    Dim AAOSRtix4 As String
    Dim AAOSRtix5 As Long
    Dim AAOSRrt As String

    '
    Table8 -Incident Response Tickets(AAO)
    Dim AAOINdate1 As String
    Dim AAOINdate2 
    As String
    Dim AAOINdate3 
    As String
    Dim AAOINdate4 
    As String
    Dim AAOINdate5 
    As String
    Dim AAOINtix1 
    As Long
    Dim AAOINtix2 
    As Long
    Dim AAOINtix3 
    As Long
    Dim AAOINtix4 
    As Long
    Dim AAOINtix5 
    As Long
    Dim AAOINrt 
    As String


    Dim RowCount 
    As Long
    Dim PortedData2 
    As Object
    Dim sheetno 
    As Integer

        
    'Source File Directory
        '
    Opens the dialog
         wbSource 
    Application _
     
    .GetOpenFilename("Excel Files (*.xlsx), *.xlsx")
    On Error GoTo noSource
    If wbSource <> False Then
     MsgBox 
    "Open " wbSource
    End 
    If
        
    'opens the selected file
        Set wbReport = Workbooks.Open(wbSource)

        '
    Table1 -Service Desk Monitoring Data
        DateRange1 
    wbReport.Worksheets("2").Range("A4").Value
        DateRange2 
    wbReport.Worksheets("2").Range("A5").Value
        DateRange3 
    wbReport.Worksheets("2").Range("A6").Value
        DateRange4 
    wbReport.Worksheets("2").Range("A7").Value
        DateRange5 
    wbReport.Worksheets("2").Range("A8").Value
        AcceptedCalls1 
    wbReport.Worksheets("2").Range("B4").Value wbReport.Worksheets("2").Range("B27").Value
        AcceptedCalls2 
    wbReport.Worksheets("2").Range("B5").Value wbReport.Worksheets("2").Range("B28").Value
        AcceptedCalls3 
    wbReport.Worksheets("2").Range("B6").Value wbReport.Worksheets("2").Range("B29").Value
        AcceptedCalls4 
    wbReport.Worksheets("2").Range("B7").Value wbReport.Worksheets("2").Range("B30").Value
        AcceptedCalls5 
    wbReport.Worksheets("2").Range("B8").Value wbReport.Worksheets("2").Range("B31").Value

        
        
    'Table2 -Customer Reporting Source Data
        Tickets1 = wbReport.Worksheets("2").Range("B9").Value + wbReport.Worksheets("2").Range("B32").Value
        Tickets2 = wbReport.Worksheets("2").Range("D21").Value + wbReport.Worksheets("2").Range("D32").Value
        Tickets3 = wbReport.Worksheets("2").Range("F9").Value + wbReport.Worksheets("2").Range("F32").Value
        
        '
    Table3 -Service Request Tickets(IITData
        SRDate1 
    wbReport.Worksheets("4").Range("A26").Value
        SRDate2 
    wbReport.Worksheets("4").Range("A27").Value
        SRDate3 
    wbReport.Worksheets("4").Range("A28").Value
        SRDate4 
    wbReport.Worksheets("4").Range("A29").Value
        SRDate5 
    wbReport.Worksheets("4").Range("A30").Value
        SRTickets1 
    wbReport.Worksheets("4").Range("B15").Value wbReport.Worksheets("4").Range("B26").Value
        SRTickets2 
    wbReport.Worksheets("4").Range("B16").Value wbReport.Worksheets("4").Range("B27").Value
        SRTickets3 
    wbReport.Worksheets("4").Range("B17").Value wbReport.Worksheets("4").Range("B28").Value
        SRTickets4 
    wbReport.Worksheets("4").Range("B18").Value wbReport.Worksheets("4").Range("B29").Value
        SRTickets5 
    wbReport.Worksheets("4").Range("B19").Value wbReport.Worksheets("4").Range("B30").Value
        TotalSRTickets 
    wbReport.Worksheets("4").Range("B20").Value wbReport.Worksheets("4").Range("B31").Value
        SRResponseTime 
    "100%"
            
            
        'Table4 -Incident Tickets(IIT) Data
        INDate1 = wbReport.Worksheets("6").Range("A20").Value
        INDate2 = wbReport.Worksheets("6").Range("A21").Value
        INDate3 = wbReport.Worksheets("6").Range("A22").Value
        INDate4 = wbReport.Worksheets("6").Range("A23").Value
        INDate5 = wbReport.Worksheets("6").Range("A24").Value
        INTickets1 = wbReport.Worksheets("6").Range("B20").Value
        INTickets2 = wbReport.Worksheets("6").Range("B21").Value
        INTickets3 = wbReport.Worksheets("6").Range("B22").Value
        INTickets4 = wbReport.Worksheets("6").Range("B23").Value
        INTickets5 = wbReport.Worksheets("6").Range("B24").Value
        INResponseTime = "100%"
        
        '
    Table5 -Top Incidents(IIT)
        
    'Table6 -Top Service Requests(IIT)
        
        '
    Table7 -Service Request Tickets(AAO)
        
    AAOSRdate1 wbReport.Worksheets("4").Range("A26").Value
        AAOSRdate2 
    wbReport.Worksheets("4").Range("A27").Value
        AAOSRdate3 
    wbReport.Worksheets("4").Range("A28").Value
        AAOSRdate4 
    wbReport.Worksheets("4").Range("A29").Value
        AAOSRdate5 
    wbReport.Worksheets("4").Range("A30").Value
        AAOSRtix1 
    wbReport.Worksheets("4").Range("B4").Value
        AAOSRtix2 
    wbReport.Worksheets("4").Range("B5").Value
        AAOSRtix3 
    wbReport.Worksheets("4").Range("B6").Value
        AAOSRtix4 
    "zero"
        
    AAOSRtix5 wbReport.Worksheets("4").Range("B7").Value
        AAOSRrt 
    "100%"
        
        'Table8 -Incident Response(AAO)
        AAOINdate1 = wbReport.Worksheets("6").Range("A20").Value
        AAOINdate2 = wbReport.Worksheets("6").Range("A21").Value
        AAOINdate3 = wbReport.Worksheets("6").Range("A22").Value
        AAOINdate4 = wbReport.Worksheets("6").Range("A23").Value
        AAOINdate5 = wbReport.Worksheets("6").Range("A24").Value
        AAOINtix1 = wbReport.Worksheets("6").Range("B4").Value
        AAOINtix2 = wbReport.Worksheets("6").Range("B5").Value
        AAOINtix3 = wbReport.Worksheets("6").Range("B6").Value
        AAOINtix4 = wbReport.Worksheets("6").Range("B7").Value
        AAOINtix5 = wbReport.Worksheets("6").Range("B8").Value
        AAOINrt = "100%"
        
        '
    Set PortedData Workbooks.Open("C:\Users\Sam\Desktop\MP Stuff\PortedData.xlsx")
        
    Set PortedData2 CreateObject("EXCEL.APPLICATION")
        
    Set PortedData PortedData2.Workbooks.Add
        
        
    'PortedData.Worksheets.Add Count:="1"
        
        sheetno = 1
        PortedData.Worksheets(sheetno).Activate
        
        '
    Table1 -Service Desk Monitoring Table format
        PortedData
    .Worksheets("Sheet1").Range("A6:C11").Borders.LineStyle xlContinuous
        PortedData
    .Worksheets("Sheet1").Range("A6, B6, C6").Interior.Color RGB(192192192)
        
    PortedData.Worksheets("Sheet1").Range("A6, B6, B7, B8, B9, B10, B11, C6, C7, C8, C9, C10, C11").HorizontalAlignment xlCenter
        PortedData
    .Worksheets("Sheet1").Columns("A").ColumnWidth 34.14
        PortedData
    .Worksheets("Sheet1").Columns("B").ColumnWidth 16.14
        PortedData
    .Worksheets("Sheet1").Columns("C").ColumnWidth 16.57
        
        
    'Table2 -Customer Reporting Source Table format
        PortedData.Worksheets("Sheet1").Range("A16:B19").Borders.LineStyle = xlContinuous
        PortedData.Worksheets("Sheet1").Range("A16, B16").Interior.Color = RGB(192, 192, 192)
        PortedData.Worksheets("Sheet1").Range("A16, A17, A18, A19, B16, B17, B18, B19").HorizontalAlignment = xlCenter
        PortedData.Worksheets("Sheet1").Columns("A").ColumnWidth = 34.14
        PortedData.Worksheets("Sheet1").Columns("B").ColumnWidth = 16.14
        PortedData.Worksheets("Sheet1").Columns("C").ColumnWidth = 16.57
        
        '
    Table3 -Service Request Tickets(IITTable format
        PortedData
    .Worksheets("Sheet1").Range("A24:C30").Borders.LineStyle xlContinuous
        PortedData
    .Worksheets("Sheet1").Range("A24, B24, C24, A30").Interior.Color RGB(192192192)
        
    PortedData.Worksheets("Sheet1").Range("A24, B24, B25, B26, B27, B28, B29, B30, C24, C25, C26, C27, C28, C29, C30").HorizontalAlignment xlCenter
        PortedData
    .Worksheets("Sheet1").Columns("A").ColumnWidth 34.14
        PortedData
    .Worksheets("Sheet1").Columns("B").ColumnWidth 16.14
        PortedData
    .Worksheets("Sheet1").Columns("C").ColumnWidth 25.57
        
        
    'Table4 -Incident Tickets(IIT) Table format
        PortedData.Worksheets("Sheet1").Range("A35:C40").Borders.LineStyle = xlContinuous
        PortedData.Worksheets("Sheet1").Range("A35, B35, C35").Interior.Color = RGB(192, 192, 192)
        PortedData.Worksheets("Sheet1").Range("A35, B35, B36, B37, B38, B39, B40, C35, C36, C37, C38, C39, C40").HorizontalAlignment = xlCenter
        PortedData.Worksheets("Sheet1").Columns("A").ColumnWidth = 34.14
        PortedData.Worksheets("Sheet1").Columns("B").ColumnWidth = 16.14
        PortedData.Worksheets("Sheet1").Columns("C").ColumnWidth = 25.57 

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

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

    PHP Code: 
     
        
    'Output directory
        '    
    PortedData.SaveAs ("C:\Users\itsm-student\Desktop\test.xlsx")
        
    PortedData.SaveAs Filename:=Application.GetSaveAsFilename_
        fileFilter
    :="Excel Files (*.xlsx), *.xlsx")
       

        
    PortedData.Close SaveChanges:=True
        wbReport
    .Close SaveChanges:=True
        
        
    noSource
    :


    End Sub 
    I'll be starting another thread to ask about dynamic row/column selection. Thx Norie and those that contributed for all the information!

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

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

    PHP Code: 
        'Table5 -Top Incident(IIT) Table format
        PortedData.Worksheets("Sheet1").Range("A45:E52").Borders.LineStyle = xlContinuous
        PortedData.Worksheets("Sheet1").Range("A45, B45, C45, D45, E45").Interior.Color = RGB(192, 192, 192)
        PortedData.Worksheets("Sheet1").Range("A45, A46, A47, A48, A49, A50, A51, A52, B45, B46, B47, B48, B49, B50, B51, B52, C45, C46, C47, C48, C49, C50, C51, C52, D45, E45").HorizontalAlignment = xlCenter
        PortedData.Worksheets("Sheet1").Columns("A").ColumnWidth = 30.14
        PortedData.Worksheets("Sheet1").Columns("B").ColumnWidth = 16.14
        PortedData.Worksheets("Sheet1").Columns("C").ColumnWidth = 25.57
        PortedData.Worksheets("Sheet1").Columns("D").ColumnWidth = 30.14
        PortedData.Worksheets("Sheet1").Columns("E").ColumnWidth = 30.14
        
        '
    Table6 -Top Service Requests(IITTable format
        PortedData
    .Worksheets("Sheet1").Range("A57:D59").Borders.LineStyle xlContinuous
        PortedData
    .Worksheets("Sheet1").Range("A57, B57, C57, D57").Interior.Color RGB(192192192)
        
    PortedData.Worksheets("Sheet1").Range("A57, A58, A59, B57, B58, B59, C57, C58, C59, D57, D58, D59").HorizontalAlignment xlCenter
        PortedData
    .Worksheets("Sheet1").Columns("A").ColumnWidth 30.14
        PortedData
    .Worksheets("Sheet1").Columns("B").ColumnWidth 25.14
        PortedData
    .Worksheets("Sheet1").Columns("C").ColumnWidth 25.57
        PortedData
    .Worksheets("Sheet1").Columns("D").ColumnWidth 30.14

        
    'Table7 -Service Request Tickets(AAO) Table format
        PortedData.Worksheets("Sheet1").Range("A64:C69").Borders.LineStyle = xlContinuous
        PortedData.Worksheets("Sheet1").Range("A64, B64, C64").Interior.Color = RGB(192, 192, 192)
        PortedData.Worksheets("Sheet1").Range("A64, A65, A66, A67, A68, A69, B64, B65, B66, B67, B68, B69, C64, C65, C66, C67, C68, C69").HorizontalAlignment = xlCenter
        PortedData.Worksheets("Sheet1").Columns("A").ColumnWidth = 34.14
        PortedData.Worksheets("Sheet1").Columns("B").ColumnWidth = 25.14
        PortedData.Worksheets("Sheet1").Columns("C").ColumnWidth = 25.57
        
        '
    Table8 -Incident Response(AAOTable format
        PortedData
    .Worksheets("Sheet1").Range("A74:C79").Borders.LineStyle xlContinuous
        PortedData
    .Worksheets("Sheet1").Range("A74, B74, C74").Interior.Color RGB(192192192)
        
    PortedData.Worksheets("Sheet1").Range("A74, A75, A76, A77, A78, A79, B74, B75, B76, B77, B78, B79, C74, C75, C76, C77, C78, C79").HorizontalAlignment xlCenter
        PortedData
    .Worksheets("Sheet1").Columns("A").ColumnWidth 34.14
        PortedData
    .Worksheets("Sheet1").Columns("B").ColumnWidth 25.14
        PortedData
    .Worksheets("Sheet1").Columns("C").ColumnWidth 25.57
        
        With PortedData
            RowCount 
    = .Worksheets("Sheet1").Range("A1")
            
            
    With .Worksheets("Sheet1").Range("A1")
                .
    Offset(00) = "Appendix"
                
                'Table1 -Service Desk Monitoring Cell values
                .Offset(3, 0) = "Service Desk Monitoring"
                .Offset(5, 0) = "Date"
                .Offset(5, 1) = "Accepted Calls"
                .Offset(5, 2) = "Dropped Calls"
                .Offset(6, 0) = DateRange1
                .Offset(7, 0) = DateRange2
                .Offset(8, 0) = DateRange3
                .Offset(9, 0) = DateRange4
                .Offset(10, 0) = DateRange5
                .Offset(6, 1) = AcceptedCalls1
                .Offset(7, 1) = AcceptedCalls2
                .Offset(8, 1) = AcceptedCalls3
                .Offset(9, 1) = AcceptedCalls4
                .Offset(10, 1) = AcceptedCalls5
                .Offset(6, 2) = DroppedCalls
                .Offset(7, 2) = DroppedCalls
                .Offset(8, 2) = DroppedCalls
                .Offset(9, 2) = DroppedCalls
                .Offset(10, 2) = DroppedCalls
                
                '
    Table2 -Customer Reporting Source Cell values
                
    .Offset(130) = "Customer Reporting Source"
                
    .Offset(150) = "Customer Reporting Source"
                
    .Offset(151) = "No. of Tickets"
                
    .Offset(160) = "Phone Calls"
                
    .Offset(170) = "Walk-in"
                
    .Offset(180) = "Self Help Portal"
                
    .Offset(161) = Tickets1
                
    .Offset(171) = Tickets2
                
    .Offset(181) = Tickets3

                
                
    'Table3 -Service Request tickets(IIT) Cell values
                .Offset(21, 0) = "Service Request Tickets (IIT)"
                .Offset(23, 0) = "Date"
                .Offset(23, 1) = "No. of Tickets"
                .Offset(23, 2) = "%Meet Response Time"
                .Offset(24, 0) = SRDate1
                .Offset(25, 0) = SRDate2
                .Offset(26, 0) = SRDate3
                .Offset(27, 0) = SRDate4
                .Offset(28, 0) = SRDate5
                .Offset(29, 0) = "BYOD & IIT"
                .Offset(24, 1) = SRTickets1
                .Offset(25, 1) = SRTickets2
                .Offset(26, 1) = SRTickets3
                .Offset(27, 1) = SRTickets4
                .Offset(28, 1) = SRTickets5
                .Offset(29, 1) = TotalSRTickets
                .Offset(24, 2) = SRResponseTime
                .Offset(25, 2) = SRResponseTime
                .Offset(26, 2) = SRResponseTime
                .Offset(27, 2) = SRResponseTime
                .Offset(28, 2) = SRResponseTime
                
                '
    Table4 -Incident Tickets(IITCell values
                
    .Offset(320) = "Incident Tickets (IIT)"
                
    .Offset(340) = "Date"
                
    .Offset(341) = "No. of Tickets"
                
    .Offset(342) = "%Meet Response Time"
                
    .Offset(350) = INDate1
                
    .Offset(360) = INDate2
                
    .Offset(370) = INDate3
                
    .Offset(380) = INDate4
                
    .Offset(390) = INDate5
                
    .Offset(351) = INTickets1
                
    .Offset(361) = INTickets2
                
    .Offset(371) = INTickets3
                
    .Offset(381) = INTickets4
                
    .Offset(391) = INTickets5
                
    .Offset(352) = INResponseTime
                
    .Offset(362) = INResponseTime
                
    .Offset(372) = INResponseTime
                
    .Offset(382) = INResponseTime
                
    .Offset(392) = INResponseTime
                
                
    'Table5 Top Incidents(IIT) Cell values
                .Offset(42, 0) = "Top Incidents (IIT)"
                .Offset(44, 0) = "No"
                .Offset(45, 0) = "1"
                .Offset(46, 0) = ""
                .Offset(47, 0) = ""
                .Offset(48, 0) = ""
                .Offset(49, 0) = "2"
                .Offset(50, 0) = ""
                .Offset(51, 0) = ""
                .Offset(44, 1) = "Issue"
                .Offset(45, 1) = "Issue1"
                .Offset(46, 1) = ""
                .Offset(47, 1) = ""
                .Offset(48, 1) = ""
                .Offset(49, 1) = "Issue2"
                .Offset(50, 1) = ""
                .Offset(51, 1) = ""
                .Offset(44, 2) = "Cases"
                .Offset(45, 2) = "NumOfCases1"
                .Offset(46, 2) = ""
                .Offset(47, 2) = ""
                .Offset(48, 2) = ""
                .Offset(49, 2) = "NumOfCases2"
                .Offset(50, 2) = ""
                .Offset(51, 2) = ""
                .Offset(44, 3) = "Symptom"
                .Offset(45, 3) = ""
                .Offset(46, 3) = ""
                .Offset(47, 3) = ""
                .Offset(48, 3) = ""
                .Offset(49, 3) = ""
                .Offset(50, 3) = ""
                .Offset(51, 3) = ""
                .Offset(44, 4) = "Remarks"
                .Offset(45, 4) = ""
                .Offset(46, 4) = ""
                .Offset(47, 4) = ""
                .Offset(48, 4) = ""
                .Offset(49, 4) = ""
                .Offset(50, 4) = ""
                .Offset(51, 4) = ""
                
                '
    Table6 Top Service Requests(IITCell values
                
    .Offset(540) = "Top Service Requests(IIT)"
                
    .Offset(560) = "No"
                
    .Offset(570) = "1"
                
    .Offset(580) = "2"
                
    .Offset(561) = "Types of Service Request"
                
    .Offset(571) = "1"
                
    .Offset(581) = "2"
                
    .Offset(562) = "Cases"
                
    .Offset(572) = ""
                
    .Offset(582) = ""
                
    .Offset(563) = "Remarks"
                
    .Offset(573) = ""
                
    .Offset(583) = ""
                
                'Table7 Service Request Tickets(AAO) Cell values
                .Offset(61, 0) = "Service Request Tickets(ARM)"
                .Offset(63, 0) = "Date"
                .Offset(64, 0) = AAOSRdate1
                .Offset(65, 0) = AAOSRdate2
                .Offset(66, 0) = AAOSRdate3
                .Offset(67, 0) = AAOSRdate4
                .Offset(68, 0) = AAOSRdate5
                .Offset(63, 1) = "No. of Tickets"
                .Offset(64, 1) = AAOSRtix1
                .Offset(65, 1) = AAOSRtix2
                .Offset(66, 1) = AAOSRtix3
                .Offset(67, 1) = AAOSRtix4
                .Offset(68, 1) = AAOSRtix5
                .Offset(63, 2) = "%Meet Response Time"
                .Offset(64, 2) = AAOSRrt
                .Offset(65, 2) = AAOSRrt
                .Offset(66, 2) = AAOSRrt
                .Offset(67, 2) = AAOSRrt
                .Offset(68, 2) = AAOSRrt
                
                '
    Table8 Service Request Tickets(AAOCell values
                
    .Offset(710) = "Incident Response(ARM)"
                
    .Offset(730) = "Date"
                
    .Offset(740) = AAOINdate1
                
    .Offset(750) = AAOINdate2
                
    .Offset(760) = AAOINdate3
                
    .Offset(770) = AAOINdate4
                
    .Offset(780) = AAOINdate5
                
    .Offset(731) = "No. of Tickets"
                
    .Offset(741) = AAOINtix1
                
    .Offset(751) = AAOINtix2
                
    .Offset(761) = AAOINtix3
                
    .Offset(771) = AAOINtix4
                
    .Offset(781) = AAOINtix5
                
    .Offset(732) = "No. of Tickets"
                
    .Offset(742) = AAOSRrt
                
    .Offset(752) = AAOSRrt
                
    .Offset(762) = AAOSRrt
                
    .Offset(772) = AAOSRrt
                
    .Offset(782) = AAOSRrt
                
            End With
                
        End With 

+ Reply to Thread

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. 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. 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