Results 1 to 10 of 17

Thread: VBA Code to Open Workbook and copy data

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    Replace the following lines

    Code:
    UniqueHeaders Application.Index(d, 1, 0)
    For r = 2 To UBound(d, 1) 'skips header
    with

    Code:
    UniqueHeaders Application.Index(d, 2, 0)'second row holds the header
    For r = 3 To UBound(d, 1) 'skips header
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  2. #2
    Senior Member
    Join Date
    Apr 2012
    Posts
    193
    Rep Power
    14
    Hi

    Thanks for the reply & your help

    When activating the macro, it now comes up with run time error 9 "subscript out of range" and the folowing code is highlighted

    k(n, j) = d(r, c)

    It would be appreciated if you would amend your code and advise accordingly

Similar Threads

  1. Replies: 2
    Last Post: 05-28-2013, 05:32 PM
  2. Replies: 17
    Last Post: 05-22-2013, 11:58 PM
  3. Replies: 7
    Last Post: 05-17-2013, 10:38 PM
  4. Replies: 0
    Last Post: 04-20-2013, 10:07 AM
  5. VBA code to copy data from source workbook
    By Howardc in forum Excel Help
    Replies: 1
    Last Post: 07-30-2012, 09:28 AM

Posting Permissions

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