Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8514659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:55:51+00:00 2026-06-11T04:55:51+00:00

Problem: I have about 50,000 rows in Excel. Each row contains a the word

  • 0

Problem:

I have about 50,000 rows in Excel. Each row contains a the word domain=[a-Z0-9]
where [a-Z0-9] is a placeholder for a bunch of numbers and text like a GUID. This domain ID let’s call abc123 it is unique. However in the 50,000 rows it is not a unique key for the table so I need to make it unique by removing all the other rows where domain ID = abc123. But I have to do this for all domains so I can’t be specific. I need a script to figure this out. The domain ID is always in the same column and there many different domain ID’s that repeat themselves.

Sample

column 2
abunchofstuff3123123khafadkfh23k4h23kh*DomainID=abc123*

Pseudo Code

//Whenever there is a value for domain in row i col 2    
//does it already exist in ListOfUniqueDomains?  
//if so then remove this row  
//else add to the ListOfUniqueDomains

How would one do this with Excel/VBA?

UPDATED ANSWER
So I really liked the idea of using Pivot Tables but I still had to extract the domain ID so I thought I’d post the solution to that portion here. I actually stole the function from some other website while googling but I lost the original post to give proper credit. So forgive me if that person is you but give yourself a pat on the back and I’ll buy you lunch if you’re in my neighborhood (easy everyone).

So in my case I had 2 delimeters (=, &) for the string domain=abc123& which is embedded in a longer string. So to extract the domain ID I did the following.

 Public Function extract_value(str As String) As String
    Dim openPos As Integer
    Dim closePos As Integer
    Dim midBit As String
     On Error Resume Next
    openPos = InStr(str, "=") 'get the position of the equal sign
     On Error Resume Next
    closePos = InStr(str, "&") ' get the position of the &
     On Error Resume Next

    midBit = Mid(str, openPos + 1, closePos - 1) 
   'get the string that is between equal sign and before '&' however this seems  
   'greedy and so it 'picked up the last '&'.I used split to get the first occurrence
   'of '&' because that was how my string was designed.

   Dim s As String
    s = Split(midBit, "&")(0)
    extract_value = s

    End Function

Is VBA even a good idea for something like this?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:55:53+00:00Added an answer on June 11, 2026 at 4:55 am

    I’ve done this for some fairly large file (50k rows) where I needed to extract only unique elements. What I’ve done is quite simple: use a pivot table. This way you don’t even need VBA, but if you want to process it further it’s still very simple to update the table and extract data.

    One of the reasons I really love this method is that it is extremely easy and powerful at the same time. You have no looping or algorithm to write, it’s all right there in the Excel features.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a performance problem with the (WPF Toolkit) DataGrid. It contains about 1.000
I have a website that lets people view rows in a table (each row
The Problem I have a table that's about 2 million rows (at 115 MB)
I have two tables: poll_response (poll_id, option_id, user_id) (about 500,000 rows, with 500 unique
Abstract problem : I have a graph of about 250,000 nodes and the average
I have a table with about 2,000,000 rows. I need to query one of
Imagine the following problem: You have a database containing about 20,000 texts in a
I have been thinking about a way solve a problem I have and I'm
This sounds like a problem many others have posted about, but there's a nuance
I have a problem about casting a CallableStatement to OracleCallableStatement . It gives ClassCastException

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.