+ Reply to Thread
Results 1 to 8 of 8

Append Data to Original Dataset Using Macro

  1. #1
    Registered User
    Join Date
    06-19-2019
    Location
    London
    MS-Off Ver
    2016
    Posts
    4

    Exclamation Append Data to Original Dataset Using Macro

    Hi All,

    I was wondering whether anybody could help with the following task I am faced with. I am a VBA beginner and I am having trouble appending some data to an original dataset.

    I am trying to search a reference in a one spreadsheet and append the relevant fields to the end of the dataset. The number of fields to be appended to the original dataset can vary. I have attached an example for your reference.

    Any help would be greatly appreciated.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Append Data to Original Dataset Using Macro

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    06-19-2019
    Location
    London
    MS-Off Ver
    2016
    Posts
    4

    Re: Append Data to Original Dataset Using Macro

    Thank-you for your reply Mumps1, its greatly appreciated!

    I keep getting the following error when the code reaches to the 'Set data' portion of the code when I apply it to my dataset:

    Object Variable or With block Variable not set.

    Could you advise why this may be?

    Also, I needed the columns for each of the references in the 'Example Extract' tab to be aligned - so that the transposed data from column A and column B of the 'Data' tab align for each of the different references (e.g. Tow123, Tow 456 etc)

    Thank-you!

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Append Data to Original Dataset Using Macro

    When I tried the macro on the file you posted, it worked properly. A macro that works with sample data very often will not work on the actual data. Can you please post a copy of your file with a little more data to make it more representative of your actual file and also the expected results in each sheet.

  5. #5
    Registered User
    Join Date
    06-19-2019
    Location
    London
    MS-Off Ver
    2016
    Posts
    4

    Re: Append Data to Original Dataset Using Macro

    Please see attached
    Attached Files Attached Files

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Append Data to Original Dataset Using Macro

    Try the attached file.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-19-2019
    Location
    London
    MS-Off Ver
    2016
    Posts
    4

    Re: Append Data to Original Dataset Using Macro

    That worked perfectly! Thank you so much!

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Append Data to Original Dataset Using Macro

    My pleasure.

+ 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 - Append Excel Data to another Dataset
    By vasweetheart05 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-22-2016, 11:30 PM
  2. [SOLVED] How can I append data to the end of a column with a macro
    By pgfindlay in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-25-2013, 08:02 AM
  3. [SOLVED] Macro to append data
    By garethmckeever74 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-23-2013, 05:35 AM
  4. Macro to Append Data
    By ExcelQ1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-23-2013, 01:14 PM
  5. Replies: 2
    Last Post: 06-02-2012, 01:14 AM
  6. Macro to append data
    By DonFlak in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2011, 02:27 PM
  7. macro to append data
    By abuchan in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-25-2010, 01:11 PM

Tags for this Thread

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