+ Reply to Thread
Results 1 to 8 of 8

VBA for a huge database.. 800k lines...

  1. #1
    Registered User
    Join Date
    11-25-2015
    Location
    UK
    MS-Off Ver
    2008
    Posts
    10

    VBA for a huge database.. 800k lines...

    Right,

    I have 800000+ cells with varying text in, split between 50 different runs, around 17000 in the first run, so
    A B C D E
    1 Text
    1 Text
    1 Text
    1 Text
    2 Text
    2 Text
    2 Text

    etc

    I need the script to search the text for certain phrases and then count how many of these there are per run per phrase. (I have 7 phrases)

    I managed to do this for the 1st set using Functions but know it would be easier with VBA and with 800k lines for this first Excel sheet.

    I need it to show the run in Column C and then how many times each phrase has appeared across the row.

    A B C D E
    Run Phrase 1 Phrase 2 etc......
    1 Text 1
    1 Text 2
    1 Text 3
    1 Text 4
    2 Text 5
    2 Text 6
    2 Text 7

    Can anyone help? I haven't got much to go on!

    Ste

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: VBA for a huge database.. 800k lines...

    This sounds doable, but a sample worksheet is preferred. As you can see, your formatting didn't turn out great.

    If you can show two sheets, a before and after, that would help. Data set doesn't have to be huge, as long as you get your point across, and can demonstrate things like what exactly splits two runs, etc.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,924

    Re: VBA for a huge database.. 800k lines...

    Would a pivot table work? Pivot tables can be quick and efficient ways to summarize large databases of information. It may also be easier to set up than coding a routine in VBA.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    11-25-2015
    Location
    UK
    MS-Off Ver
    2008
    Posts
    10

    Re: VBA for a huge database.. 800k lines...

    Example Phrase sheet.xlsx

    Heres a little example sheet for you to get an idea, Im pretty new to VBA and most of the kit im working with so if you could help that would be great!

    Ste

  5. #5
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: VBA for a huge database.. 800k lines...

    as Mentioned by MrShorty a pivottable would be the easiest way to do it see my example

    Pivot.PNG
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-25-2015
    Location
    UK
    MS-Off Ver
    2008
    Posts
    10

    Re: VBA for a huge database.. 800k lines...

    This is close, but i dont want all of the Phrases. only certain ones.

    I forgot to say these words are in sentences in the Phrase part,

    So it would be
    "A defeated B at point 340"

    but that could account for A-Z worth of objects.

    Heres a slightly bigger version of what i Have

    Example Phrase sheet.xlsx

  7. #7
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: VBA for a huge database.. 800k lines...

    Hi There,

    I still dont think that a Macro is needed and also not that it would be faster

    Here is an Example with a Simple Formula to Scan the Text and count it
    I inserted 800k Rows to see if it takes forever or not and it doesnt :D
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-25-2015
    Location
    UK
    MS-Off Ver
    2008
    Posts
    10

    Re: VBA for a huge database.. 800k lines...

    Quote Originally Posted by LordLoki View Post
    Hi There,

    I still dont think that a Macro is needed and also not that it would be faster

    Here is an Example with a Simple Formula to Scan the Text and count it
    I inserted 800k Rows to see if it takes forever or not and it doesnt :D
    think you have cracked it my friend! I shall try and apply it to mine and let you know how i get on!

+ 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. Replies: 2
    Last Post: 01-14-2016, 11:25 AM
  2. Replies: 4
    Last Post: 11-15-2015, 06:18 AM
  3. Replies: 7
    Last Post: 04-12-2015, 11:46 AM
  4. Suppliers Management database - Huge help need it!!!
    By Danny77 in forum Access Tables & Databases
    Replies: 6
    Last Post: 07-03-2014, 12:48 PM
  5. huge sheet convert to database?
    By chemmiah in forum Excel General
    Replies: 1
    Last Post: 08-17-2011, 09:15 AM
  6. Vlookup a HUGE database
    By djvice in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-02-2009, 11:28 PM
  7. copying and inserting huge amount of lines
    By Guy in forum Excel General
    Replies: 0
    Last Post: 08-14-2008, 02:32 PM

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