+ Reply to Thread
Results 1 to 12 of 12

Mass insert in large database

  1. #1
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Mass insert in large database

    Dear Gurus,
    I have a database of about 34,000 rows. These represent three months worth of driving data. I need to insert the home zip code "90058" (column I-ship_zip) BEFORE and AFTER each Route (column A). The routes have different number of stops, thus different number of rows. I have attached part of the file in question. How to do it?
    Thank you very much.
    Attached Files Attached Files
    Last edited by kisboros; 04-06-2012 at 11:34 AM. Reason: Disallowed title

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Maybe programming question?

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Maybe programming question?

    Hi
    I have the soln. But can I upload it now? Asking becoz of that rule violation msg..

  4. #4
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Maybe programming question?

    I changed the title according to the rules. Please reply with your solution. Thank you!

  5. #5
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Mass insert in large database

    Hi
    Try this:
    test file for forum.xlsm

    Regards...

  6. #6
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Mass insert in large database

    Hi,
    Unfortunately this didn't work. It just replaced the route numbers with duplicated zip codes. I need to put in "90058" prior and after each zip code in column I. The goal is to eventually calculate mileage between home office, routing stops, and back to home office.
    Thanks.

  7. #7
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Mass insert in large database

    Quote Originally Posted by kisboros View Post
    Hi,
    Unfortunately this didn't work. It just replaced the route numbers with duplicated zip codes. I need to put in "90058" prior and after each zip code in column I. The goal is to eventually calculate mileage between home office, routing stops, and back to home office.
    Thanks.
    I am re-attaching a modified test file to see the effect I am trying to achieve.
    Attached Files Attached Files

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Mass insert in large database

    Hi,

    One way:

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Mass insert in large database

    This is what I did: I opened up VBA editor; copied and pasted your code. Then I had to enable macros, and then I clicked on 'Run" and got an error message:
    Compile error: Invalid outside procedure.
    Would it make any difference that it is tab 7 in a workbook? I can see that 'Sheet 7' is highlighted on the sidebar.
    Thank you.

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Mass insert in large database

    Hi,

    The macro should be run with the sheet containing the data is the active sheet. It could be changed to refer to a specific sheet.

    Is your real data EXACTLY the same layout as your example on which the macro is based?

  11. #11
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Mass insert in large database

    Hi Richard,
    Yes it is. I cut and pasted from the original. Would this forum allow me to send the entire sheet to you to see?
    Thanks,
    Eva

  12. #12
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Mass insert in large database

    Hell Eva,


    You don't need to send the entire workbook if it's very large. Just delete most of the rows but leave a good representative sample and upload.

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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