Big Apology To Krishnakumar.
I'm really really sorry about this.
Krishnakumar.
I owe you a big apology here.
I told you your code didn't work.
I'm not sure what the hell I was doing with it yesterday, but I've tried it today and it works fine!!!!
I feel really really bad about this.
You are all busy people I expect, and here I am, completely green as grass, asking you to help me.
You're all good enough to help, then I tell you your Formula doesn't work, and it does!!!!!!!
Again, I am really sorry.
To explain a bit further though,
Also Jindon,
I've tried your formula this morning at 6am as I was checking my emails, and yours didn't work for me, and I've just typed quite a large text file explaining the error, but I tried it another way and it worked fine!
This is the trouble I think.
The big problem with everyone's life now isn't money (Well, it partly is
)
It's TIME!
For me, a newbie, I know what I want to be able to do, but really, I need to start from page 1 of the excel learning book and not dive into page 300! It's all about time.
I've obviously tried to "wing it" and thought I knew what I was doing, but It's been kind of trial and error, because of time.
So, A big apology again to Krishnakumar, for thinking his formula wasn't any good, when it worked perfectly in fact.
OK. 2 or 3 points though, as Jindon, yours did work 1 way, but did the other of the 2 ways I tried, but Krishnakumar's formula worked both ways.
I will explain both ways and Jindons error message.
1 question first though.
Krishnakumar and Jindon, both your code achieves the same thing.
But Jindons code is much longer than Krishnakumars.
My question is;
If both of them worked perfectly, (Slight problem with Jindons at present which I'll explain in a mo) is it always better (As a rule of thumb) to go with the code that's the shortest????
Again, I'm not a programmer, a real novice, but Krish, your code is only 42 lines long where as Jindons is 87 lines long. (More than double.
Is it best to use the shorter than the longer code or the other way around???
By the way, both these achieve the following;
I'm able to type a word/or words into a box and it looks at all my 10000 long list and creates a separate page with all the lines that contain the word that I'd entered into the box (So anyone reading this knows what I wanted to be able to do
)
OK. I'll quickly explain Jindon the error code when I ran your formula a certain way. It worked 1 way, but not the other, but Kris, yours worked both ways.
Here's briefly the 2 ways I tried to run this.
Example 1.
1.go tools/macro/visual basic
1a. then go "Insert" / module/ and paste code into module1
1b. click run/ then click run sub/user form
1c. a box appears saying "Macros" with it called "test" so I click "run"
1d it then says "Compile error, Duplicate declaration in current scope (Whatever that means
) And the cursor is pointintg to line 3 here;
Dim n As Long, myTxt As String, txt As String, b()-------(The cursor is between the "String," and the "b()"
1e. I click ok and the "sub test() on line 1 of the code is now in yellow
-----------------------------------------------------------------
That was the way it didn't work on Jindons code, I've just tried this method exactly the same way with Kris's and it worked (Sorry Jindon
)
Again, I'm so sorry to Krish, I really don't know what the hell I done wrong with it yesterday.
OK. the way both worked.
-----------------------------------------
way 2, (Working for both;
1a. go to tools/macro/vb
1b. go "insert"/ module,
1c. copy code into box.
1d. go "File" / close and return to excel
1e. go tools/macro/ macros
Sorry, as I'm typing this I'm trying all different was, and I can't get it working now????
I'm sure it worked 1 way Jindon. I just can't get it working. Sorry Jindon.
Keeps coming up with the error Like I mentioned above.
Feel bloody supid again. Saying yours works 1 way Jindon, now I can't get it working anyway
--------------------------
OK. To wrap up.
A big sorry to Krish again for saying his formulas didn't work when it did.
Sorry to Jindon. Thanks for you time on this Jindon, I feel guilty as you spent time trying to help me when Krish's formula that actually worked fine. I just don't know what I done wrong yesterday , Honestly.
In my previous post I did ask if also it was possible to do 1 more thing also.
Seeing as Krish's formula works fine (It's me that doesn't
), I'm half way to what I'm really trying to achieve.
Again a big thank you to all concerned.
The other thing I wanted to do was;
Krish's formula looks at my 10,000 rows of data, then a box comes up, I imput the word (Or words) I want it to find. It then (On another sheet) creates a list of all the rows containing the word(Or words) that I entered into the pop up box.
That's amazing. Great. But I wanted to be able to do 1 more thing.
Can, on another sheet (or in the same sheet but a few columns apart from colA,,, ie col F,, can it then give me a list of all the unique words that are in this list it returns??
So, Krish's Formula created say a 1000 row of phrases from the 10000 originally. Lets say it was to find "car hire"
So, Krish's formula gives me 1000 rows of phrase's all with the words "car hire" in them.
So, now I want a list of all the unique words (ie duplicates removed) that are in all these rows.
I hope this makes sense.
This is so, that I have a list of all the words commonly associated with the words "car hire" , kind of symantics.
I hope this could be done.
If possible. maybe even 2 formulas
1 for this function only,(Just symantic unique keyword list with duplicates removed)
and/or a formula (Krish's) that does what he has already been able to achieve, and at the same time also creates a list of unique keywords also (either on the same sheet or another).
So it returns 2 lists at the same time. 1 list with all the phrases containing the entered keyword/or words, and at the same time another list with all the unique keywords from that returned list.
Now That would be amazing!!!
I'll wrap this up now as it's getting kind of long.
Again,
Finally.
Big sorry to Krish and Jindon.
Hope you can help on this final issue.
You've all been great. I really appreciate all your efforts.
Many thanks.
Merry Christmas to you all
John